在 ubuntu 12.04 make 中找不到 Qt 库 [英] in ubuntu 12.04 make cannot find Qt libraries
问题描述
当我运行 make(在运行 qmake 之后)时,出现以下错误:
When I run make (after running qmake) I get the following error:
/usr/bin/ld: cannot find -lQtGui
/usr/bin/ld: cannot find -lQtCore
在突触中显示我已经安装了 libqtcore4 和 libqtgui4.
In synaptic it shows that I have installed libqtcore4 and libqtgui4.
没有像/usr/bin/ld 这样的目录.
There is no such directory as /usr/bin/ld.
基本上,我已经安装了 QtSDK,而且 QtCreator 似乎运行良好,因为它可以构建 hello world 程序.但我希望能够从 CLI 工作并运行 make.我怀疑我可能需要重定向 make 程序以在别处寻找 QtGui 和 QtCore.如果是这样,我如何找出这些库的位置?我正在运行 Ubuntu 12.04 并且我遵循了这个页面的建议 http://www.qtforum.org/article/28081/installing-qt-4-5-2-on-linux.html 直到最后一节讨论库.有什么建议吗?
Basically, I've installed the QtSDK, and QtCreator seems to work fine in that it can build the hello world program. But I want to be able to work from the CLI and run make. I suspect that I may need to redirect the make program to look elsewhere for QtGui and QtCore. If so, how do I find out where those libraries are? I'm running Ubuntu 12.04 and I've followed the advice of this page http://www.qtforum.org/article/28081/installing-qt-4-5-2-on-linux.html down to the last section where it talks about libraries. Any suggestions?
推荐答案
使用 apt-get 安装 Qt
Install Qt using apt-get
sudo apt-get install libqt4-core libqt4-gui
或者如果你想要一切
sudo apt-get install libqt4-*
这篇关于在 ubuntu 12.04 make 中找不到 Qt 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!