[英]/usr/bin/ld: cannot find lGL when building Qt5 app in Qt Creator on Linux Mint
[英]Qt5 Linux cannot find Qt libraries
我正在嘗試在帶有Clang的Ubuntu 12.04上使用QT5.1 Beta編譯現有的QT庫。 該項目可以使用QT4.8.4進行編譯。
使用QT5.1 Beta編譯項目時,出現以下鏈接器錯誤。
/usr/bin/ld: cannot find -lQt5OpenGL
/usr/bin/ld: cannot find -lQt5Widgets
/usr/bin/ld: cannot find -lQt5Network
/usr/bin/ld: cannot find -lQt5Gui
/usr/bin/ld: cannot find -lQt5Core
我當前的系統設置如下:
從圖標和bash啟動qtcreator時都出現錯誤。
以前使用此ubuntu系統的開發人員已使用apt-get安裝了QT4。 我認為QT4已安裝在默認的OS目錄中,並且在構建項目時始終會選擇QT4,而不是QT5。 我刪除了/ usr / **路徑下的QT4軟件包
當構建失敗時,我在qtcreator的編譯器輸出窗口中看到以下命令正在執行。
clang++ debug/moc-xxx.o -L -L/home/user/Qt5.1.0/5.1.0-beta1/gcc_64/lib -lQ5OpenGL -lQt5Widgets -lQt5Network -lQt5Gui -lGL -lpthread
沒有路徑的-L是否告訴編譯器使用系統默認路徑中的庫? 我在這里想念什么?
您需要首先使用Clang編譯Qt(以Clang-3.2為例): http : //libre.tibirna.org/projects/qgit/wiki/Compile_Qt5_with_clang
因為預構建的Linux Qt庫用於gcc。
構建Qt之后,您可以為Qt Creator配置該工具包: http : //libre.tibirna.org/projects/qgit/wiki/Compile_QGit_with_Qt5_and_clang
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.