本文實(shí)例講述了安裝安裝ImageMagick出現(xiàn)error while loading shared libraries的解決方法。分享給大家供大家參考。具體解決方法如下:
運(yùn)行程序時(shí),如遇到像下列這種錯(cuò)誤:
1
|
. /tests : error while loading shared libraries: xxx.so.0:cannot open shared object file : No such file or directory |
那就表示系統(tǒng)不知道xxx.so 放在哪個(gè)目錄下。
這個(gè)時(shí)候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。
一般而言,有很多so檔會(huì)在/usr/local/lib這個(gè)目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。
將 /etc/ld.so.conf存檔后,還要執(zhí)行「/sbin/ldconfig –v」來(lái)更新一下才會(huì)生效。
希望本文所述對(duì)大家有所幫助。