Important: Please read the Qt Code of Conduct -

Include files

  • Maybe it's my age, but where does one specify one's headers? I'm moving from 'another' IDE to QT4. The other had a menu where I specified directories where headers and libraries are located, that are to be included in the program.

    The Help file made some reference to the possibility, but I have not found any concrete instruction on how to actually go about it. It might be in one of the tutorials. A link will do. It seems very basic task everyone knows, except yours truly. :)

  • Hm... I don't know how to do it with menus in Qt Creator (I use emacs =P), but as a start, I can say you need to add the paths to headers to the INCLUDEPATH variable and libraries goes to the LIBS variable, both in the .pro file of your project. :-)

    Let's wait a little until someone who is more habituated with Qt Creator answer :-)

  • Anselmolsm Yes we have to add the all the header files path, Library paths to System PATH variable. It will work

  • Just for curiosity: Which IDE or build system do you use together with Qt? I'm not aware of any that evaluates a single PATH variable for both headers and libs...

  • To anselmolsen: Thanks. You were right on target. As seconded by Pavanesh. It does work, even for me; the proverbial Hello program did compile just right now.

    To Volker: A little known IDE called wxDev-C++. You open the environment menu, and simply choose and click, where the include files are, libraries, where your targets ought to be and so on. The IDE not in the professional class off IDEs, (neiher am I btw) but once you're done selecting, the path(s) are written into a 'make' file for any compiler you choose. Very fast, and you don't worry about a typo. I love this IDE, but unfortunately, my hobby is growing and I have to move on.

    To all: Thanks for those quick responses. :D

Log in to reply