Domanda

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 ?

È stato utile?

Soluzione

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?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top