joesmith1234
October 27th, 2008, 11:45 PM
THIS IS A QUESTION ABOUT HEADERS AND COMPILERS. NOT ABOUT QT.
Also, 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 qt tutorials.
I tried to add the following to the tutorial source:
#include <QGraphicsWidget>
The compiler says it can't find it.
I went and checked out a demo app that has that header included, the padnavigator.
The padnavigator example compiles fine, but the header declaration is different:
#include <QtGui/qgraphicswidget.h>
I try this header back in the tutorial, and the compiler still can't find the header.
I then tried comparing the two make files.
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 the tutorial'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.
How can I force the compilers and this qmake to build the makefile so it uses the libraries and headers for the new installation of Qt?
Note: I also ran into this problem when I had compiled GStreamer. All of my new code always ended up linking to the original GStreamer on the system at install.
:confused:
Also, 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 qt tutorials.
I tried to add the following to the tutorial source:
#include <QGraphicsWidget>
The compiler says it can't find it.
I went and checked out a demo app that has that header included, the padnavigator.
The padnavigator example compiles fine, but the header declaration is different:
#include <QtGui/qgraphicswidget.h>
I try this header back in the tutorial, and the compiler still can't find the header.
I then tried comparing the two make files.
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 the tutorial'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.
How can I force the compilers and this qmake to build the makefile so it uses the libraries and headers for the new installation of Qt?
Note: I also ran into this problem when I had compiled GStreamer. All of my new code always ended up linking to the original GStreamer on the system at install.
:confused: