Results 1 to 3 of 3

Thread: problem with include files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    9
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: problem with include files

    Hi,

    did you use qmake to set up a project file as described in the same tutorial?

    If not run "qmake -project" followed "qmake" and then "make" in the directory your project is in. This should work without setting up any path to the header files.

    Else if the project doesn't work try to tell the compiler explicit where it finds the headers by appending

    -I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/mkspecs/linux-g++ -I/usr/local/Trolltech/Qt-4.2.2/include

    to your g++ calls. When you link everything together you also need to specify which libraries to use for this. Append
    -L/usr/local/Trolltech/Qt-4.2.2/lib -lQtGui -lQtCore

    Now it should compile and link without errors.

    If you get linker errors when you start the application you need to set the path to the Qt libraries in the LD_LIBRARY_PATH environment variable.

    You can also add the above includes to the CPLUS_INCLUDE_PATH variable. Btw. the PATH variable should only contain paths to binaries. The compiler doesn't look there for anything.

    Hope it helps.

  2. The following user says thank you to ggrinder for this useful post:

    JR (22nd December 2006)

Similar Threads

  1. QApplication: no such file or directory
    By jochen_r in forum Newbie
    Replies: 13
    Last Post: 15th November 2008, 21:46
  2. Problem converting .ui files from Qt3 to 4
    By Amanda in forum Qt Programming
    Replies: 6
    Last Post: 28th October 2006, 04:34
  3. problem with an include
    By mickey in forum General Programming
    Replies: 1
    Last Post: 20th July 2006, 13:45
  4. Replies: 7
    Last Post: 2nd June 2006, 12:48
  5. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 20:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.