Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    I've set the includepath to QtCore in pro file but that doesn't work and includes still give error

    General and Desktop
    windows pro includepath qtcore qtcreator qmake qt5.4 c++
    2
    4
    2563
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      carlos91moreira last edited by

      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 the INCLUDEPATH 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 :)

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • C
          carlos91moreira last edited by

          Hi,

          thanks very much once again.

          That worked perfectly :D

          How can I set this as closed (or solved)?

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Easy: just edit the thread title and prepend [solved] :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post