PDA

View Full Version : compile opengl examples



balinsky
12th February 2009, 18:45
Using: kubuntu 8.10

All i am trying to do as of now is compile the opengl qt examples

I believe I have everything set up correctly (right packages installed, proprietary nvidia driver installed)

compiling the hellogl example as so I get


jebsky@jeboat:~/kdedev/opengl/hellogl$ qmake -project
jebsky@jeboat:~/kdedev/opengl/hellogl$ qmake "QT += opengl" hellogl.pro
jebsky@jeboat:~/kdedev/opengl/hellogl$ 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/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/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o glwidget.o glwidget.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -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/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -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/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o window.o window.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -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/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o moc_glwidget.o moc_glwidget.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -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/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I/usr/X11R6/include -I. -I. -o moc_window.o moc_window.cpp
g++ -Wl,--no-undefined -o hellogl glwidget.o main.o window.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
make: *** [hellogl] Error 1

I do not know what usr/bin/ld does....

any insight would be awesome

jeff

spirit
13th February 2009, 06:22
according to error there is no OpenGL installed on your machine.

drhex
13th February 2009, 07:03
apt-get install these two packages (and ensure that your Qt installation was configured with -opengl)

libgl1-mesa-dev
libglu1-mesa-dev

balinsky
14th February 2009, 23:59
how do i configure my qt installation with -opengl?

drhex
15th February 2009, 08:25
I do it like this:

download latest sources
unpack, cd to the new directory
clear the QMAKESPEC environment variable
./configure -opengl
make
make install (as root)


(although the very latest version qt-x11-opensource-src-4.5.0-rc1 fails to install because of some valgrind problem)

balinsky
16th February 2009, 00:33
o i see. So you cant do it installing from package managers?

now that i know that i should be able to get it

thanks

edit: not sure what clear the QMAKESPEC environment variable means but ill wing it