我尝试使用 qmake 构建一个 QT 项目.为此,我需要 boost 库.
I try to build an QT project using qmake. For this I need the boost library.
LIBS += -L/usr/lib/ \ -lboost_system \ -lboost_filesystem但是在运行 qmake 之后,这些库并没有添加到 makefile 中:
But after running qmake, these libraries are not added to the makefile:
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5MultimediaWidgets -L/build/buildd/qtmultimedia-opensource-src-5.0.1/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/x86_64-linux-gnu -lQt5OpenGL -lQt5Multimedia -lpulse -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread正如预期的那样,链接器打印了许多错误,例如
As expected, the linker prints many error like
/usr/include/boost/system/error_code.hpp:214: error: undefined reference to boost::system::generic_category()如果您想查看整个 .pro 文件,请转到 raw.github/francisengelmann/FabScan100/master/qtTest/qtTest.pro
If you want to take a look to the whole .pro file, go to raw.github/francisengelmann/FabScan100/master/qtTest/qtTest.pro
我也遇到了与 opencv 类似的问题.有谁知道如何解决这个问题?
I am also having a similar problem with opencv. Does anyone know how to solve this issue ?
推荐答案更改.pro文件后需要再次运行qmake.仅删除您的构建目录是不够的.
You need to run qmake again after changing the .pro file. Just removing your build directory is not enough.
另外你确定你的 qmake 目标是 linux-g++ 吗?INCLUDEPATH 是否有效?
Also are you sure your qmake target is linux-g++? Does the INCLUDEPATH work?
更多推荐
qmake 不会将 .pro 文件中的库添加到 makefile
发布评论