PDA

View Full Version : porting issue



sajis997
9th December 2012, 15:22
Hello forum


I have developed a small opengl application with Qt. Not i am porting the application to the new qt version qt 4.8.0

I having the following linker problem while linking



GroupBoxCommandExtendedBox.o moc_LabelCounter.o moc_FrustumMainWidget.o moc_OrthoMainWidget.o moc_PerspectiveMainWidget.o moc_SharedWidgetData.o moc_glWidgetWorldSpace.o moc_glWidgetScreenSpace.o moc_ProjectionMainWindow.o moc_GroupBoxCommandExtendedBox.o -L/usr/lib/i386-linux-gnu -L/usr/X11R6/lib -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
glWidgetWorldSpace.o: In function `GLWidgetWorldSpace::worldReshape(int, int)':
/home/sajjad/Documents/realtimerendering/projection/glWidgetWorldSpace.cpp:85: undefined reference to `gluPerspective'
glWidgetScreenSpace.o: In function `GLWidgetScreenSpace::screenReshape(int, int)':
/home/sajjad/Documents/realtimerendering/projection/glWidgetScreenSpace.cpp:95: undefined reference to `gluPerspective'
/home/sajjad/Documents/realtimerendering/projection/glWidgetScreenSpace.cpp:125: undefined reference to `gluLookAt'
collect2: ld returned 1 exit status
make: *** [projection] Error 1




I have opengl driver installed in my system and it is functional as i have run the qt demos


Any hint to get around this problem ?


Regards
Sajjadul

amleto
9th December 2012, 20:27
compare the opengl demo .pro files to your .pro file. What was your previous version of Qt?

sajis997
10th December 2012, 02:22
Hi
it was done done in qt 4.4 . There is no substantial change i believe in qt 4.8.

I included the .pro file for you review




QT += opengl
HEADERS += \
LabelCounter.h \
FrustumMainWidget.h \
OrthoMainWidget.h \
PerspectiveMainWidget.h \
SharedWidgetData.h \
glWidgetWorldSpace.h \
glWidgetScreenSpace.h \
glm.h \
ProjectionMainWindow.h \
singleton.h \
GLToolkit.h \
GroupBoxCommandExtendedBox.h

SOURCES += \
LabelCounter.cpp \
FrustumMainWidget.cpp \
OrthoMainWidget.cpp \
PerspectiveMainWidget.cpp \
SharedWidgetData.cpp \
glWidgetWorldSpace.cpp \
glWidgetScreenSpace.cpp \
glm.cpp \
ProjectionMainWindow.cpp \
main.cpp \
GLToolkit.cpp \
GroupBoxCommandExtendedBox.cpp

FORMS += \
projection.ui \
perspective.ui \
ortho.ui \
frustum.ui




Thanks
Sajjadul

norobro
10th December 2012, 04:12
Here you go: QTBUG-12227 (https://bugreports.qt-project.org/browse/QTBUG-12227)

As stated in the comments, add the following to your project file:
LIBS += -lGLU