linux下一類通用錯誤的解決方案

來源:互聯網
上載者:User
linux下一類 通用錯誤的解決方案

編譯原始碼的時候,會經常出現一類錯誤就是:
/usr/bin/ld: cannot find -libutempter
更加通用點的就是
/usr/bin/ld: cannot find -l***
後面的星星表示一類錯誤的名字。這個錯誤的原因很簡單,就是連結錯誤,很簡單的做法就是手動設定連結一次,就拿
/usr/bin/ld: cannot find -libutempter
來說:
我們現在lib檔案夾下面去看看該類庫檔案存在的形式:
cd /usr/lib
ls -la | grep iutempter
得到如下:
lrwxrwxrwx   1 root root       20 09-10 19:26 libutempter.so.0 -> libutempter.so.1.1.4
-rwxr-xr-x   1 root root     6216 2007-01-07 libutempter.so.1.1.4
很明顯,沒有.so檔案,我們再次連結一個.so檔案就是了
ln -s libutempter.so.0 libutempter.so
可以再編譯一下是不是就可以了

還有,比如
/usr/bin/ld: cannot find -lelf
也是類型,在lib檔案夾下執行一個連結:
ln -s /usr/lib/libelf.so.1  /usr/lib/libelf.so
這裡假定存在.so.1這個庫檔案

還有:
/usr/bin/ld: cannot find -lc
這個是不存在libc.so
同樣給出一個libc.so的連結就是了
~
~
~
~
~
~

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.