PDA

View Full Version : Trouble finding headers.



bob_the_badger
10th October 2008, 14:04
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:

#include <QGraphicsWidget>

The compiler says it can't find it.

The padnavigator example compiles fine, but the header declaration is different:

#include <QtGui/qgraphicswidget.h>

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:

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.

In the padnavigator make there's:

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


Just FYI, the padnavigator code is located on my desktop:

/home/nibbles/Desktop/qt-x11-opensource-src-4.4.2/examples/graphicsview/padnavigator

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?

:confused:

maverick_pol
10th October 2008, 14:48
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

bob_the_badger
13th October 2008, 07:57
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.

wysota
13th October 2008, 08:16
I guess you lack a QT+=opengl (and maybe other things) in your project file.

bob_the_badger
13th October 2008, 09:25
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.

wysota
16th October 2008, 23:02
Could you post your project file?