qmake doesn't add libraries from .pro file to the makefile

强颜欢笑 提交于 2019-12-12 02:35:55

问题


I try to build an QT project using qmake. For this I need the boost library.

LIBS += -L/usr/lib/ \
 -lboost_system \
 -lboost_filesystem

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()

If you want to take a look to the whole .pro file, go to https://raw.github.com/francisengelmann/FabScan100/master/qtTest/qtTest.pro

I am also having a similar problem with opencv. Does anyone know how to solve this issue ?


回答1:


You need to run qmake again after changing the .pro file. Just removing your build directory is not enough.

Also are you sure your qmake target is linux-g++? Does the INCLUDEPATH work?



来源:https://stackoverflow.com/questions/20496908/qmake-doesnt-add-libraries-from-pro-file-to-the-makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!