문제

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 ?

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top