Results 1 to 6 of 6

Thread: Trouble finding headers.

  1. #1

    Question Trouble finding headers.

    When reading this, please keep in mind that I'm fairly n00b to linux. I'm running Ubuntu 8.04.

    I was playing around with the padnavigator example.

    I tried to copy it into my own widget, I started getting all kind of errors for not finding header files.

    Then I went to the old version of my widget and just tried to include:
    Qt Code:
    1. #include <QGraphicsWidget>
    To copy to clipboard, switch view to plain text mode 

    The compiler says it can't find it.

    The padnavigator example compiles fine, but the header declaration is different:
    Qt Code:
    1. #include <QtGui/qgraphicswidget.h>
    To copy to clipboard, switch view to plain text mode 

    I try this header in my own widget, and the compiler still can't find the header.

    I then tried comparing the two make files.

    In padnavigator's make:

    In my make there's:
    Qt Code:
    1. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    To copy to clipboard, switch view to plain text mode 

    In the padnavigator make there's:
    Qt Code:
    1. INCPATH = -I../../../mkspecs/linux-g++ -I. -I../../../include/QtCore -I../../../include/QtCore -I../../../include/QtGui -I../../../include/QtGui -I../../../include/QtOpenGL -I../../../include/QtOpenGL -I../../../include -I/usr/X11R6/include -I.moc/release-shared -I.uic/release-shared
    To copy to clipboard, switch view to plain text mode 


    Just FYI, the padnavigator code is located on my desktop:
    Qt Code:
    1. /home/nibbles/Desktop/qt-x11-opensource-src-4.4.2/examples/graphicsview/padnavigator
    To copy to clipboard, switch view to plain text mode 

    So what I think is happening, is that qmake somehow automatically determines the location of the include paths when making the make file. Is correct?

    Next, the include path for my own widget's makefile appears to be wrong. When I do a "make install" from the source code located on my desktop, everything is installed to /usr/local/Trolltech/Qt-4.4.2/ and not /usr/include/qt4/ . I assume the latter is the Qt version that was already on the system when I installed ubuntu.

    I understand that these questions are probably more relevant to Linux or Ubuntu rather than any Qt, but I don't really know where else to start asking.

    Nonetheless, how can I force qmake to build the makefile so it uses the libraries and headers for the new installation of Qt?


  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Trouble finding headers.

    Hi,

    If you example is short ,please paste you code here or attach an archive with the code.
    It is probably a simple error.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  3. #3

    Default Re: Trouble finding headers.

    It's just the "hello world" app from the tutorial and I've added the line "#include <QGraphicsWidget>"

    This is a linux / qmake / makefile / PATH issue, not really anything to do with source code.

    I just don't know where else to start.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Trouble finding headers.

    I guess you lack a QT+=opengl (and maybe other things) in your project file.

  5. #5

    Default Re: Trouble finding headers.

    Quote Originally Posted by wysota View Post
    I guess you lack a QT+=opengl (and maybe other things) in your project file.
    I added it, but the makefile still points to the wrong headers.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Trouble finding headers.

    Could you post your project file?

Similar Threads

  1. deleting selected headers
    By ru_core in forum Qt Programming
    Replies: 3
    Last Post: 16th April 2008, 07:53

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.