I've set the includepath to QtCore in pro file but that doesn't work and includes still give error
-
Hello all,
After some days of this first experience with Qt I'm still facing lots of errors because of all the includes that I have.
I have this project and I need it to compile in Windows. I understand that I need to point the paths to the files needed in the .pro file.
But now I'm stuck in a circle.In the
INCLUDEPATH
I have:INCLUDEPATH += . \ rcsc/formation \ rcsc/geom \ rcsc \ rcsc/time \ rcsc/param \ rcsc/common \ rcsc/rcg \ $(BOOST_ROOT) \ "C:/Qt/5.4/mingw491_32/include/QtCore" \ "C:/tese/boost_1_58_0/boost"
With this I get an error in this line:
#include <boost/weak_ptr.hpp>
. But I have the path to that file (is the last line).
If I remove the last lines (please notice the 3 # sign):INCLUDEPATH += . \ rcsc/formation \ rcsc/geom \ rcsc \ rcsc/time \ rcsc/param \ rcsc/common \ rcsc/rcg \ $(BOOST_ROOT) **#**\ **#**"C:/tese/boost_1_58_0/boost" \ **#**"C:/Qt/5.4/mingw491_32/include/QtCore"
The error I get is in line:
#include <QtCore/qpair.h>
(no such file or directory found)This error lead me to include the line
"C:/Qt/5.4/mingw491_32/include/QtCore"
to theINCLUDEPATH
and I go back to the top of this problem.I've this in .pro file as well:
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += core greaterThan(QT_MAJOR_VERSION, 4): QT += gui
This is my .pro file:
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += core greaterThan(QT_MAJOR_VERSION, 4): QT += gui TARGET = matchflow TEMPLATE = app DEPENDPATH += rcsc \ rcsc/common \ rcsc/formation \ rcsc/geom \ rcsc/param \ rcsc/rcg \ rcsc/time INCLUDEPATH += . \ rcsc/formation \ rcsc/geom \ rcsc \ rcsc/time \ rcsc/param \ rcsc/common \ rcsc/rcg \ $(BOOST_ROOT) #\ #"C:/tese/boost_1_58_0/boost" \ #"C:/Qt/5.4/mingw491_32/include/QtCore" LIBS += -lstdc++
And the rest are Headers and Sources.
If anyone ever had the same problem please help me.
Many Thanks :) -
Hi,
You should rather be including QPair.
Note that you only need
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
for the widgets part because they have moved in their own module in Qt 5 -
Hi,
thanks very much once again.
That worked perfectly :D
How can I set this as closed (or solved)?
-
Easy: just edit the thread title and prepend [solved] :)