Qt-interest Archive, July 2006
qt opengl linking errors
Message 1 in thread
Hi,
I am facing a strange problem. I hav a QT+OPENGL project which was working fine till sometime back and then suddenly it started throwing up a top of weird linking errors.
It seems that it is unable to link with QGL libraries as I am facing no problem when I compile my program without any opengl widegts included.
Kindly indicate what am i doing wrong. Note that I have included lGL and lGLU in my link command.
thanks,
RK
my Makefile seems file with following commands
++ -c -pipe -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -Wall -W -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -I/usr/include -I/usr/X11R6/include -o gamewidget.o gamewidget.cpp
gamewidget.cpp:479:1: warning: multi-line comment
gamewidget.cpp: In member function `void GameWidget::buildDisplayLists()':
gamewidget.cpp:734: warning: unused variable `GLfloat white[4]'
gamewidget.cpp: In member function `void GameWidget::drawTriangle(int, GameWidget::vector3d*)':
gamewidget.cpp:834: warning: unused variable `GLfloat colSign[3]'
gamewidget.cpp: In member function `GLfloat* GameWidget::getDirColor(int, GLfloat*, int)':
gamewidget.cpp:757: warning: unused parameter `int focus'
g++ -c -pipe -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -Wall -W -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -I/usr/include -I/usr/X11R6/include -o main.o main.cpp
g++ -c -pipe -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -Wall -W -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -I/usr/include -I/usr/X11R6/include -o mainwindow.o mainwindow.cpp
/usr/lib/qt3/bin/moc gamewidget.hpp -o moc_gamewidget.cpp
g++ -c -pipe -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -Wall -W -O2 -fmessage-length=0 -Wall -g -DUSE_LIB64_PATHES -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -I/usr/include -I/usr/X11R6/include -o moc_gamewidget.o moc_gamewidget.cpp
g++ -o HippoGL gamewidget.o main.o mainwindow.o moc_gamewidget.o -L/usr/lib64/ -L/usr/lib/qt3/lib64/ -L/usr/lib64/ -L/usr/X11R6/lib64/ -lqt -lGLU -lGL -lXmu -lXext -lX11 -lm
and following are the errors that I get
gamewidget.o(.text+0x3a44): In function `GameWidget::~GameWidget [in-charge deleting]()':
/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:250: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3a67):/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:251: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3ab4): In function `GameWidget::~GameWidget [in-charge]()':
/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:250: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3ace):/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:251: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3b14): In function `GameWidget::~GameWidget [not-in-charge]()':
/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:250: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3b2e):/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:251: more undefined references to `QGLWidget::~QGLWidget [not-in-charge]()' follow
gamewidget.o(.text+0x3b5c): In function `GameWidget::GameWidget[in-charge](QWidget*, char const*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:37: undefined reference to `QGLWidget::QGLWidget[not-in-charge](QWidget*, char const*, QGLWidget const*, unsigned)'
gamewidget.o(.text+0x3d1a):/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:74: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
gamewidget.o(.text+0x3d5c): In function `GameWidget::GameWidget[not-in-charge](QWidget*, char const*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:37: undefined reference to `QGLWidget::QGLWidget[not-in-charge](QWidget*, char const*, QGLWidget const*, unsigned)'
gamewidget.o(.text+0x3f1a):/cise/homes/rkkumar/ra/santosh/HippoGL/gamewidget.cpp:74: undefined reference to `QGLWidget::~QGLWidget [not-in-charge]()'
main.o(.text+0x42): In function `main':
/cise/homes/rkkumar/ra/santosh/HippoGL/main.cpp:19: undefined reference to `QGLFormat::hasOpenGL()'
moc_gamewidget.o(.text+0x65): In function `GameWidget::qt_property(int, int, QVariant*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/moc_gamewidget.cpp:130: undefined reference to `QGLWidget::qt_property(int, int, QVariant*)'
moc_gamewidget.o(.text+0x85): In function `GameWidget::qt_emit(int, QUObject*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/moc_gamewidget.cpp:124: undefined reference to `QGLWidget::qt_emit(int, QUObject*)'
moc_gamewidget.o(.text+0x126): In function `GameWidget::staticMetaObject()':
moc_gamewidget.o(.text+0x126): In function `GameWidget::staticMetaObject()':
/cise/homes/rkkumar/ra/santosh/HippoGL/moc_gamewidget.cpp:54: undefined reference to `QGLWidget::staticMetaObject()'
moc_gamewidget.o(.text+0x1dc): In function `GameWidget::qt_invoke(int, QUObject*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/moc_gamewidget.cpp:117: undefined reference to `QGLWidget::qt_invoke(int, QUObject*)'
moc_gamewidget.o(.text+0xee): In function `GameWidget::qt_cast(char const*)':
/cise/homes/rkkumar/ra/santosh/HippoGL/moc_gamewidget.cpp:98: undefined reference to `QGLWidget::qt_cast(char const*)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x158): undefined reference to `QGLWidget::setMouseTracking(bool)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x210): undefined reference to `QGLWidget::reparent(QWidget*, unsigned, QPoint const&, bool)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x290): undefined reference to `QGLWidget::paintEvent(QPaintEvent*)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x2a0): undefined reference to `QGLWidget::resizeEvent(QResizeEvent*)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x380): undefined reference to `QGLWidget::makeCurrent()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x388): undefined reference to `QGLWidget::swapBuffers()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x390): undefined reference to `QGLWidget::setFormat(QGLFormat const&)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x398): undefined reference to `QGLWidget::setContext(QGLContext*, QGLContext const*, bool)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3a0): undefined reference to `QGLWidget::renderPixmap(int, int, bool)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3a8): undefined reference to `QGLWidget::grabFrameBuffer(bool)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3b0): undefined reference to `QGLWidget::makeOverlayCurrent()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3b8): undefined reference to `QGLWidget::updateGL()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3c0): undefined reference to `QGLWidget::updateOverlayGL()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3e0): undefined reference to `QGLWidget::initializeOverlayGL()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3e8): undefined reference to `QGLWidget::resizeOverlayGL(int, int)'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3f0): undefined reference to `QGLWidget::paintOverlayGL()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x3f8): undefined reference to `QGLWidget::glInit()'
moc_gamewidget.o(.gnu.linkonce.r._ZTV10GameWidget+0x400): undefined reference to `QGLWidget::glDraw()'
moc_gamewidget.o(.gnu.linkonce.r._ZTI10GameWidget+0x10): undefined reference to `typeinfo for QGLWidget'
collect2: ld returned 1 exit status
make: *** [HippoGL] Error 1
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Message 2 in thread
Have you changed your compiler recently? Was Qt built using a different
compiler than your application?
--
[ signature omitted ]