(转)cannot find -l*解决

转自http://i-pogo.blogspot.com/2010/01/usrbinld-cannot-find-lxxx.html

問題:

在linux環境編譯應用程式或lib的source code時常常會出現如下的錯誤訊息:

/usr/bin/ld: cannot find -lxxx

這些訊息會隨著編譯不同類型的source code 而有不同的結果出來如:

/usr/bin/ld: cannot find -lc

/usr/bin/ld: cannot find -lltdl

/usr/bin/ld: cannot find -lXtst

其中xxx即表示函式庫文件名稱,如上例的:libc.so、libltdl.so、libXtst.so。

其命名規則是:lib+庫名(即xxx)+.so。

會發生這樣的原因有以下三種情形:

1 系統沒有安裝相對應的lib

2 相對應的lib版本不對

3 lib(.so檔)的symbolic link 不正確,沒有連結到正確的函式庫文件(.so)

猜你喜欢

转载自lanxinyuchs.iteye.com/blog/1275014