Do you have both Qt3 and Qt4 installed?
It could be that the qmake of Qt3 is called.
I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.
one quick way to fix it is to change the order of the Qt3 and Qt4 paths in your PATH variable.
Have the Qt4 path be first.
You might want to check that LD_LIBRARY_PATH knows where your Qt4 libs are.
End you should change your signature, since you are on Fedora and not XP![]()
I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.
what jpn meant is the print out of the your make file - when you run make, you see in the console the commands make is running.
We need the first command that makes runs.
it looks similar to this:
Also you might want to look at this: http://doc.trolltech.com/4.2/qmake-e...reference.htmlg++ -c -Wall -W -O2 -fPIC -DQT_SHARED -DQT_NO_DEBUG -DQT_NO_NIS
-DQT_NO_XINERAMA -DQT_NO_XRENDER -DQT_NO_XFTFREETYPE -DQT_NO_XKB -DQT_NO_REMOTE
-DQT_NO_IMAGEIO_MNG -DQT_NO_IMAGEIO_JPEG -DQT_NO_STYLE_AQUA -DQT_NO_STYLE_MAC
-DQT_NO_STYLE_INTERLACE -DQT_NO_STYLE_COMPACT -I3rdparty/libpng -I3rdparty/zlib
-I/usr/local/qt/include -I../../../include -I../../../include -I/usr/local/qt/mkspecs/
[root@localhost 2and3D]# qmake -project
//changed .pro file and added QT += opengl
[root@localhost 2and3D]# qmake
[root@localhost 2and3D]# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/root/qt-x11-opensource-src-4.2.2/mkspecs/linux-g++ -I. \
-I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -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/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.2.2/include -I. -I/usr/X11R6/include -I. -I. -o form.o form.cpp
In file included from form.h:5,
from form.cpp:2:
glwidget.h:5:30: error: QtOpenGL/QGLWidget: No such file or directory
glwidget.h:8: error: expected class-name before ‘{’ token
glwidget.h:36: error: ‘GLuint’ does not name a type
glwidget.h:37: error: ‘GLdouble’ has not been declared
glwidget.h:37: error: ‘GLdouble’ has not been declared
glwidget.h:37: error: ‘GLdouble’ has not been declared
glwidget.h:37: error: ‘GLdouble’ has not been declared
glwidget.h:38: error: ‘GLdouble’ has not been declared
glwidget.h:38: error: ‘GLdouble’ has not been declared
glwidget.h:38: error: ‘GLdouble’ has not been declared
glwidget.h:38: error: ‘GLdouble’ has not been declared
glwidget.h:39: error: ‘GLdouble’ has not been declared
glwidget.h:39: error: ‘GLdouble’ has not been declared
glwidget.h:39: error: ‘GLdouble’ has not been declared
glwidget.h:39: error: ‘GLdouble’ has not been declared
glwidget.h:42: error: ‘GLuint’ does not name a type
glwidget.h:8: warning: ‘class GLWidget’ has virtual functions but non-virtual destructor
form.cpp: In constructor ‘MainWindow::MainWindow(QMainWindow*)â€℠¢:
form.cpp:41: error: ‘class GLWidget’ has no member named ‘setGeometry’
make: *** [form.o] Error 1
[root@localhost 2and3D]#
[root@localhost ~]# env
SSH_AGENT_PID=2598
HOSTNAME=localhost.localdomain
DESKTOP_STARTUP_ID=
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc-1.2-gnome2
WINDOWID=41950507
QTDIR=/root/qt-x11-opensource-src-4.2.2
QTINC=/root/qt-x11-opensource-src-4.2.2/include
USER=root
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:s o=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi= 01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com =00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00 ;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;3 1:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz =00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00; 31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;3 5:\
*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
GNOME_KEYRING_SOCKET=/tmp/keyring-lB9HNn/socket
SSH_AUTH_SOCK=/tmp/ssh-TkJpfF2555/agent.2555
KDEDIR=/usr
SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/2555
MAIL=/var/spool/mail/root
DESKTOP_SESSION=default
PATH=/root/qt-x11-opensource-src-4.2.2/bin:/root/qt-x11-opensource-src-4.2.2/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:\
/usr/X11R6/bin:/root/qt-x11-opensource-src-4.2.2/bin:/root/bin
GDM_XSERVER_LOCATION=local
INPUTRC=/etc/inputrc
PWD=/root
LANG=en_US.UTF-8
QMAKESPEC=/root/qt-x11-opensource-src-4.2.2/mkspecs/linux-g++
GDMSESSION=default
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/root
SHLVL=2
GNOME_DESKTOP_SESSION_ID=Default
LOGNAME=root
QTLIB=/root/qt-x11-opensource-src-4.2.2/lib
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-XG0E1vGhF5,guid=752ef945ca242e50a5d2bb9767ffcd00
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
COLORTERM=gnome-terminal
XAUTHORITY=/root/.Xauthority
_=/bin/env
[root@localhost ~]#
Last edited by jacek; 15th March 2007 at 11:54. Reason: wrapped too long lines
I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.
well first, you can take QtOpenGL from the include line since qmake adds it ok:
If this doesn't work, it means you didn't install Qt with openGL support.-I/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL
Wait a minute, is this where your Qt4 is?:
QTDIR=/root/qt-x11-opensource-src-4.2.2
QTINC=/root/qt-x11-opensource-src-4.2.2/include
I think the problem is here..
/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL---> compiler is serching this path
QTDIR=/root/qt-x11-opensource-src-4.2.2 ---> Qt is installed here.
QTINC=/root/qt-x11-opensource-src-4.2.2/include ---> Takes this PATH to include
I think you need to change the environment settings or uninstall and reinstall Qt again![]()
hi all,
i reinstalled Qt with option -opengl but in the end of ./configure -prefix-install - opengl it gave as :
...
rm -f libQtSvg.so.4.2.2 libQtSvg.so libQtSvg.so.4 libQtSvg.so.4.2
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.2.2/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.2.2/lib -shared -Wl,-soname,libQtSvg.so.4 -o libQtSvg.so.4.2.2 .obj/release-shared/qsvggraphics.o .obj/release-shared/qsvghandler.o .obj/release-shared/qsvgnode.o .obj/release-shared/qsvgstructure.o .obj/release-shared/qsvgstyle.o .obj/release-shared/qsvgfont.o .obj/release-shared/qsvgtinydocument.o .obj/release-shared/qsvgrenderer.o .obj/release-shared/qsvgwidget.o .obj/release-shared/qgraphicssvgitem.o .obj/release-shared/moc_qsvgwidget.o -L/usr/local/Trolltech/Qt-4.2.2/lib -lQtXml -L/usr/local/Trolltech/Qt-4.2.2/lib -lQtGui -L/usr/X11R6/lib -lpng -lSM -lICE -lXrender -lXrandr -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -lglib-2.0 -lpthread -ldl
ln -s libQtSvg.so.4.2.2 libQtSvg.so
ln -s libQtSvg.so.4.2.2 libQtSvg.so.4
ln -s libQtSvg.so.4.2.2 libQtSvg.so.4.2
rm -f ../../lib/libQtSvg.so.4.2.2
rm -f ../../lib/libQtSvg.so
rm -f ../../lib/libQtSvg.so.4
rm -f ../../lib/libQtSvg.so.4.2
mv -f libQtSvg.so.4.2.2 libQtSvg.so libQtSvg.so.4 libQtSvg.so.4.2 ../../lib/
(test -z "../../lib/" || cd "../../lib/" ; targ=`basename libQtSvg.so.4.2.2`; objcopy --only-keep-debug "$targ" "$targ.debug" && objcopy --strip-debug "$targ" && objcopy --add-gnu-debuglink="$targ.debug" "$targ" && chmod -x "$targ.debug" ) ;
gmake[2]: Leaving directory `/usr/local/Trolltech/Qt-4.2.2/src/svg'
cd opengl && gmake -f Makefile
gmake[2]: Entering directory `/usr/local/Trolltech/Qt-4.2.2/src/opengl'
/usr/local/Trolltech/Qt-4.2.2/bin/qmake -spec ../../mkspecs/linux-g++ -unix -o Makefile opengl.pro
gmake[2]: Leaving directory `/usr/local/Trolltech/Qt-4.2.2/src/opengl'
gmake[2]: Entering directory `/usr/local/Trolltech/Qt-4.2.2/src/opengl'
g++ -c -pipe -g -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_OPENGL_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtCore -I../../include/QtGui -I../../include/QtGui -I../../include -I../../include/QtOpenGL -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/X11R6/include -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qgl.o qgl.cpp
In file included from qgl.cpp:26:
qgl.h:60:21: error: GL/glu.h: No such file or directory
../../include/QtCore/../../src/corelib/thread/qthreadstorage.h: In static member function ‘static void QThreadStorage<T>::deleteData(void*) [with T = QGLThreadContext*]’:
../../include/QtCore/../../src/corelib/thread/qthreadstorage.h:116: instantiated from ‘QThreadStorage<T>::QThreadStorage() [with T = QGLThreadContext*]’
qgl.cpp:39: instantiated from here
../../include/QtCore/../../src/corelib/thread/qthreadstorage.h:113: warning: dereferencing type-punned pointer will break strict-aliasing rules
gmake[2]: *** [.obj/release-shared/qgl.o] Error 1
gmake[2]: Leaving directory `/usr/local/Trolltech/Qt-4.2.2/src/opengl'
gmake[1]: *** [sub-opengl-make_default] Error 2
gmake[1]: Leaving directory `/usr/local/Trolltech/Qt-4.2.2/src'
gmake: *** [sub-src-make_default-ordered] Error 2
[root@localhost Qt-4.2.2]#
so after tht i did gmake and set QMAKESPEC
no when i try to run my same program with opengl as:
qmake -project
added QT += opengl in .pro file
qmake
make [or gmake]
its giving the error as
[root@localhost 2and3D]# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.2.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -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/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.2.2/include -I. -I/usr/X11R6/include -I. -I. -o form.o form.cpp
In file included from /usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL/qgl.h:1,
from /usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL/QGLWidget:1,
from glwidget.h:5,
from form.h:5,
from form.cpp:2:
/usr/local/Trolltech/Qt-4.2.2/include/QtOpenGL/../../src/opengl/qgl.h:60:21: error: GL/glu.h: No such file or directory
make: *** [form.o] Error 1
[root@localhost 2and3D]#
there is no "glu.h" file on my system
So i think that opengl is not installed. so can u help me that how can i install with opengl?
Thanks All..
I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.
it looks like you don't have opengl installed on your system.error: GL/glu.h: No such file or directory
Make sure its installed.
When you run Qt's configure script, you should read the output configure gives, you will see there if it was able to find opengl or not. (and all other dependencied)
I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.
you can read the configure output when you call configure in your console before you compile Qt.
If you do ./configure --help, you will get a list with all options.
One of these option is -opengl or similar.
I don't know if Qt comes with its own opengl lib src. (can't remember)
At the configure help, there is a line next to some lib options that says "use system lib" or something similar, for these libs you can choose to use either a system installed lib or to compile the lib from the Qt src.
I can't remember if opengl is like that or not.
Bookmarks