Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to indicate INCLUDE PATH to QT CREATOR
Forum Updated to NodeBB v4.3 + New Features

How to indicate INCLUDE PATH to QT CREATOR

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 3 Posters 6.9k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    DragonProg
    wrote on last edited by
    #1

    Hi everybody,

    I'm sorry for the question, I know is a simnple question but I don´t find the solution.

    The thing is :

    I'm working with QT CREATOR 2.5.2 and QT 4.8.0, also I'm working with PCL (Point cloud library 1.6.0). I'm programming onto Windows 7 64 bits. I create a simple form with a button using the QT creator and everything works fine, but if I want to include a header file, the QT Creator doesn´t find the header file.

    I edited the .pro file, and I use the INCLUDEPATH += indicate the path but the QT Creator doesn´t find the header file.

    my cpp file is :

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "point_types.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    I'm not find the way to say to the QT Creator which is the include PATH, in this case "c:\Program Files\PCL 1.6.0\include"

    Please, anyone can help me, I'm really fustrated.

    Advanced thanks

    1 Reply Last reply
    0
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on last edited by
      #2

      Hi, if INCLUDEPATH doesn't seem to work, you can always specify the path in the #include, like this:
      #include "C:/Program Files/PCL 1.6.0/Include/point_types.h"

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        You should use forward slashes and also check whether the includes are in the root path of the library.

        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
        • D Offline
          D Offline
          DragonProg
          wrote on last edited by
          #4

          Thanks to everybody for the replies,

          Yes, if I put the absolute path in the include it works, so in my complete project developed with MSVS C++ and QT designer (not qt creator) I have thousans includes in hundreds files, is imposible to change all.

          And regarding forward slashes I proved everything, forward, backward, ..., I start to think is a problem with the QT creator version.

          Thank you

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DragonProg
            wrote on last edited by
            #5

            Hi again,

            I found the error, if my path has a space, INCLUDEPATH is not efective, so I have everything installed inside "Program Files".

            Any suggestion ?

            Thanks !!!!!

            1 Reply Last reply
            0
            • hskoglundH Online
              hskoglundH Online
              hskoglund
              wrote on last edited by
              #6

              Hi, the "spaces" syndrome you can cure in your .pro file by defining a variable which you then assign to the includepath, like this:
              @
              PCLINCLUDE = "c:/Program Files/PCL 1.6.0/include"
              INCLUDEPATH += $${PCLINCLUDE}
              @
              (Note that Qt is more happy with forward slashes in the directory names.)

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DragonProg
                wrote on last edited by
                #7

                Thanks !!!

                Now everything is working

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  There's also

                  @INCLUDEPATH += $$quote(c:/Program Files/PCL 1.6.0/include)@

                  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
                  • hskoglundH Online
                    hskoglundH Online
                    hskoglund
                    wrote on last edited by
                    #9

                    Yeah SGaist that one is better/shorter.

                    1 Reply Last reply
                    0

                    • Login

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