Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I've set the includepath to QtCore in pro file but that doesn't work and includes still give error

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

Scheduled Pinned Locked Moved General and Desktop
windowsproincludepathqtcoreqtcreatorqmakeqt5.4c++
4 Posts 2 Posters 3.1k Views
  • 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 Offline
    C Offline
    carlos91moreira
    wrote on 11 Sept 2015, 14:02 last edited by
    #1

    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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Sept 2015, 14:58 last edited by
      #2

      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
      0
      • C Offline
        C Offline
        carlos91moreira
        wrote on 14 Sept 2015, 14:57 last edited by
        #3

        Hi,

        thanks very much once again.

        That worked perfectly :D

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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Sept 2015, 21:49 last edited by
          #4

          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
          0

          1/4

          11 Sept 2015, 14:02

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved