Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Stuck with KDev + Qt + OpenGL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Dec 14, 2004 12:09 am    Post subject: Stuck with KDev + Qt + OpenGL Reply with quote

I have the newest KDevelop installed and my OpenGL setup works fine. I've also emerged Qt with OpenGL support. I want to try to compile a simple OpenGL test app that I've found on trolltech.com, but I'm stuck with some errors I can't resolve. Here's what I get when I try to compile with KDev:

Code:

cd '/home/test/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
Linken der Datei test (libtool)
Linken der Datei test (g++)
/home/test/src/test.cpp:30: undefined reference to `QApplication::setColorSpec(int)'
test.o(.text+0x141):/home/test/src/test.cpp:31: undefined reference to `QApplication::QApplication(int&, char**)'
test.o(.text+0x146):/home/test/src/test.cpp:33: undefined reference to `QGLFormat::hasOpenGL()'
test.o(.text+0x156):/home/test/src/test.cpp:34: undefined reference to `qWarning(char const*, ...)'
test.o(.text+0x161):/home/test/src/test.cpp:35: undefined reference to `QApplication::~QApplication()'
test.o(.text+0x1ac):/home/test/src/test.cpp:39: undefined reference to `QWidget::resize(int, int)'
test.o(.text+0x1c1):/home/test/src/test.cpp:40: undefined reference to `QApplication::setMainWidget(QWidget*)'
test.o(.text+0x1cf):/home/test/src/test.cpp:41: undefined reference to `QWidget::show()'
test.o(.text+0x1da):/home/test/src/test.cpp:42: undefined reference to `QApplication::exec()'
test.o(.text+0x1f9):/home/test/src/test.cpp:42: undefined reference to `QApplication::~QApplication()'
test.o(.text+0x240):/home/test/src/test.cpp:42: undefined reference to `QApplication::~QApplication()'
/home/test/src/test.cpp:38: undefined reference to `vtable for GLObjectWindow'
test.o(.gnu.linkonce.t._ZN14GLObjectWindowD1Ev+0x1f):/home/test/src/test.cpp:38: undefined reference to `vtable for GLObjectWindow'
test.o(.gnu.linkonce.t._ZN14GLObjectWindowD1Ev+0x2a):/home/test/src/test.cpp:38: undefined reference to `QWidget::~QWidget()'
/home/test/src/glbox.cpp:32: undefined reference to `QGLWidget::QGLWidget(QWidget*, char const*, QGLWidget const*, unsigned int)'
glbox.o(.text+0x135):/home/test/src/glbox.cpp:32: undefined reference to `vtable for GLBox'
glbox.o(.text+0x141):/home/test/src/glbox.cpp:32: undefined reference to `vtable for GLBox'
/home/test/src/glbox.cpp:32: undefined reference to `QGLWidget::QGLWidget(QWidget*, char const*, QGLWidget const*, unsigned int)'
glbox.o(.text+0x1bb):/home/test/src/glbox.cpp:32: undefined reference to `vtable for GLBox'
glbox.o(.text+0x1c7):/home/test/src/glbox.cpp:32: undefined reference to `vtable for GLBox'
/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x224):/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x22f):/home/test/src/glbox.cpp:45: undefined reference to `QGLWidget::makeCurrent()'
glbox.o(.text+0x248):/home/test/src/glbox.cpp:46: undefined reference to `glDeleteLists'
glbox.o(.text+0x25b):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
glbox.o(.text+0x274):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x2ae):/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x2b9):/home/test/src/glbox.cpp:45: undefined reference to `QGLWidget::makeCurrent()'
glbox.o(.text+0x2d2):/home/test/src/glbox.cpp:46: undefined reference to `glDeleteLists'
glbox.o(.text+0x2e5):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
glbox.o(.text+0x2fe):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x338):/home/test/src/glbox.cpp:44: undefined reference to `vtable for GLBox'
glbox.o(.text+0x343):/home/test/src/glbox.cpp:45: undefined reference to `QGLWidget::makeCurrent()'
glbox.o(.text+0x35c):/home/test/src/glbox.cpp:46: undefined reference to `glDeleteLists'
glbox.o(.text+0x36f):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
glbox.o(.text+0x388):/home/test/src/glbox.cpp:46: undefined reference to `QGLWidget::~QGLWidget()'
/home/test/src/glbox.cpp:57: undefined reference to `glClear'
glbox.o(.text+0x3bd):/home/test/src/glbox.cpp:59: undefined reference to `glLoadIdentity'
glbox.o(.text+0x3dc):/home/test/src/glbox.cpp:60: undefined reference to `glTranslatef'
glbox.o(.text+0x407):/home/test/src/glbox.cpp:61: undefined reference to `glScalef'
glbox.o(.text+0x433):/home/test/src/glbox.cpp:63: undefined reference to `glRotatef'
glbox.o(.text+0x45f):/home/test/src/glbox.cpp:64: undefined reference to `glRotatef'
glbox.o(.text+0x48b):/home/test/src/glbox.cpp:65: undefined reference to `glRotatef'
glbox.o(.text+0x49c):/home/test/src/glbox.cpp:67: undefined reference to `glCallList'
/home/test/src/glbox.cpp:77: undefined reference to `Qt::black'
glbox.o(.text+0x4b9):/home/test/src/glbox.cpp:77: undefined reference to `QGLWidget::qglClearColor(QColor const&) const'
glbox.o(.text+0x4e3):/home/test/src/glbox.cpp:79: undefined reference to `glShadeModel'
/home/test/src/glbox.cpp:90: undefined reference to `glViewport'
glbox.o(.text+0x51e):/home/test/src/glbox.cpp:91: undefined reference to `glMatrixMode'
glbox.o(.text+0x523):/home/test/src/glbox.cpp:92: undefined reference to `glLoadIdentity'
glbox.o(.text+0x55b):/home/test/src/glbox.cpp:93: undefined reference to `glFrustum'
glbox.o(.text+0x567):/home/test/src/glbox.cpp:94: undefined reference to `glMatrixMode'
/home/test/src/glbox.cpp:106: undefined reference to `glGenLists'
glbox.o(.text+0x592):/home/test/src/glbox.cpp:108: undefined reference to `glNewList'
glbox.o(.text+0x597):/home/test/src/glbox.cpp:110: undefined reference to `Qt::white'
glbox.o(.text+0x5a6):/home/test/src/glbox.cpp:110: undefined reference to `QGLWidget::qglColor(QColor const&) const'
glbox.o(.text+0x5b3):/home/test/src/glbox.cpp:112: undefined reference to `glLineWidth'
glbox.o(.text+0x5bf):/home/test/src/glbox.cpp:114: undefined reference to `glBegin'
glbox.o(.text+0x5de):/home/test/src/glbox.cpp:115: undefined reference to `glVertex3f'
glbox.o(.text+0x5fd):/home/test/src/glbox.cpp:116: undefined reference to `glVertex3f'
glbox.o(.text+0x61c):/home/test/src/glbox.cpp:117: undefined reference to `glVertex3f'
glbox.o(.text+0x63b):/home/test/src/glbox.cpp:118: undefined reference to `glVertex3f'
glbox.o(.text+0x640):/home/test/src/glbox.cpp:119: undefined reference to `glEnd'
glbox.o(.text+0x64c):/home/test/src/glbox.cpp:121: undefined reference to `glBegin'
glbox.o(.text+0x66b):/home/test/src/glbox.cpp:122: undefined reference to `glVertex3f'
glbox.o(.text+0x68a):/home/test/src/glbox.cpp:123: undefined reference to `glVertex3f'
glbox.o(.text+0x6a9):/home/test/src/glbox.cpp:124: undefined reference to `glVertex3f'
glbox.o(.text+0x6c8):/home/test/src/glbox.cpp:125: undefined reference to `glVertex3f'
glbox.o(.text+0x6cd):/home/test/src/glbox.cpp:126: undefined reference to `glEnd'
glbox.o(.text+0x6d9):/home/test/src/glbox.cpp:128: undefined reference to `glBegin'
glbox.o(.text+0x6f8):/home/test/src/glbox.cpp:129: undefined reference to `glVertex3f'
glbox.o(.text+0x717):/home/test/src/glbox.cpp:129: undefined reference to `glVertex3f'
glbox.o(.text+0x736):/home/test/src/glbox.cpp:130: undefined reference to `glVertex3f'
glbox.o(.text+0x755):/home/test/src/glbox.cpp:130: undefined reference to `glVertex3f'
glbox.o(.text+0x774):/home/test/src/glbox.cpp:131: undefined reference to `glVertex3f'
glbox.o(.text+0x793):/home/test/src/glbox.cpp:131: more undefined references to `glVertex3f' follow
/home/test/src/glbox.cpp:133: undefined reference to `glEnd'
glbox.o(.text+0x7db):/home/test/src/glbox.cpp:135: undefined reference to `glEndList'
/home/test/src/globjwin.cpp:25: undefined reference to `QWidget::QWidget(QWidget*, char const*, unsigned int)'
globjwin.o(.text+0x130):/home/test/src/globjwin.cpp:25: undefined reference to `vtable for GLObjectWindow'
globjwin.o(.text+0x13c):/home/test/src/globjwin.cpp:25: undefined reference to `vtable for GLObjectWindow'
globjwin.o(.text+0x165):/home/test/src/globjwin.cpp:28: undefined reference to `QPopupMenu::QPopupMenu(QWidget*, char const*)'
globjwin.o(.text+0x199):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::QKeySequence(int)'
globjwin.o(.text+0x1b2):/home/test/src/globjwin.cpp:29: undefined reference to `QString::QString(char const*)'
globjwin.o(.text+0x1da):/home/test/src/globjwin.cpp:29: undefined reference to `qApp'
globjwin.o(.text+0x1f2):/home/test/src/globjwin.cpp:29: undefined reference to `QMenuData::insertItem(QString const&, QObject const*, char const*, QKeySequence const&, int, int)'
globjwin.o(.text+0x228):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::~QKeySequence()'
globjwin.o(.text+0x23b):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::~QKeySequence()'
globjwin.o(.text+0x264):/home/test/src/globjwin.cpp:32: undefined reference to `QMenuBar::QMenuBar(QWidget*, char const*)'
globjwin.o(.text+0x2b5):/home/test/src/globjwin.cpp:34: undefined reference to `QString::QString(char const*)'
globjwin.o(.text+0x2e3):/home/test/src/globjwin.cpp:34: undefined reference to `QMenuData::insertItem(QString const&, QPopupMenu*, int, int)'
globjwin.o(.text+0x33a):/home/test/src/globjwin.cpp:37: undefined reference to `QFrame::QFrame(QWidget*, char const*, unsigned int)'
globjwin.o(.text+0x430):/home/test/src/globjwin.cpp:45: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0x490):/home/test/src/globjwin.cpp:47: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0x4e1):/home/test/src/globjwin.cpp:49: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0x541):/home/test/src/globjwin.cpp:51: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0x592):/home/test/src/globjwin.cpp:53: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0x5f2):/home/test/src/globjwin.cpp:55: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0x622):/home/test/src/globjwin.cpp:61: undefined reference to `QVBoxLayout::QVBoxLayout(int, char const*)'
globjwin.o(.text+0x66b):/home/test/src/globjwin.cpp:62: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0x68d):/home/test/src/globjwin.cpp:63: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0x6af):/home/test/src/globjwin.cpp:64: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0x6ee):/home/test/src/globjwin.cpp:67: undefined reference to `QHBoxLayout::QHBoxLayout(QWidget*, int, int, char const*)'
globjwin.o(.text+0x737):/home/test/src/globjwin.cpp:68: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0x776):/home/test/src/globjwin.cpp:71: undefined reference to `QHBoxLayout::QHBoxLayout(QWidget*, int, int, char const*)'
globjwin.o(.text+0x7cd):/home/test/src/globjwin.cpp:73: undefined reference to `QBoxLayout::addLayout(QLayout*, int)'
globjwin.o(.text+0x7ef):/home/test/src/globjwin.cpp:74: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0x802):/home/test/src/globjwin.cpp:74: undefined reference to `QWidget::~QWidget()'
/home/test/src/globjwin.cpp:25: undefined reference to `QWidget::QWidget(QWidget*, char const*, unsigned int)'
globjwin.o(.text+0x84e):/home/test/src/globjwin.cpp:25: undefined reference to `vtable for GLObjectWindow'
globjwin.o(.text+0x85a):/home/test/src/globjwin.cpp:25: undefined reference to `vtable for GLObjectWindow'
globjwin.o(.text+0x883):/home/test/src/globjwin.cpp:28: undefined reference to `QPopupMenu::QPopupMenu(QWidget*, char const*)'
globjwin.o(.text+0x8b7):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::QKeySequence(int)'
globjwin.o(.text+0x8d0):/home/test/src/globjwin.cpp:29: undefined reference to `QString::QString(char const*)'
globjwin.o(.text+0x8f8):/home/test/src/globjwin.cpp:29: undefined reference to `qApp'
globjwin.o(.text+0x910):/home/test/src/globjwin.cpp:29: undefined reference to `QMenuData::insertItem(QString const&, QObject const*, char const*, QKeySequence const&, int, int)'
globjwin.o(.text+0x946):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::~QKeySequence()'
globjwin.o(.text+0x959):/home/test/src/globjwin.cpp:29: undefined reference to `QKeySequence::~QKeySequence()'
globjwin.o(.text+0x982):/home/test/src/globjwin.cpp:32: undefined reference to `QMenuBar::QMenuBar(QWidget*, char const*)'
globjwin.o(.text+0x9d3):/home/test/src/globjwin.cpp:34: undefined reference to `QString::QString(char const*)'
globjwin.o(.text+0xa01):/home/test/src/globjwin.cpp:34: undefined reference to `QMenuData::insertItem(QString const&, QPopupMenu*, int, int)'
globjwin.o(.text+0xa58):/home/test/src/globjwin.cpp:37: undefined reference to `QFrame::QFrame(QWidget*, char const*, unsigned int)'
globjwin.o(.text+0xb4e):/home/test/src/globjwin.cpp:45: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0xbae):/home/test/src/globjwin.cpp:47: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0xbff):/home/test/src/globjwin.cpp:49: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0xc5f):/home/test/src/globjwin.cpp:51: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0xcb0):/home/test/src/globjwin.cpp:53: undefined reference to `QSlider::QSlider(int, int, int, int, Qt::Orientation, QWidget*, char const*)'
globjwin.o(.text+0xd10):/home/test/src/globjwin.cpp:55: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
globjwin.o(.text+0xd40):/home/test/src/globjwin.cpp:61: undefined reference to `QVBoxLayout::QVBoxLayout(int, char const*)'
globjwin.o(.text+0xd89):/home/test/src/globjwin.cpp:62: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0xdab):/home/test/src/globjwin.cpp:63: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0xdcd):/home/test/src/globjwin.cpp:64: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0xe0c):/home/test/src/globjwin.cpp:67: undefined reference to `QHBoxLayout::QHBoxLayout(QWidget*, int, int, char const*)'
globjwin.o(.text+0xe55):/home/test/src/globjwin.cpp:68: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0xe94):/home/test/src/globjwin.cpp:71: undefined reference to `QHBoxLayout::QHBoxLayout(QWidget*, int, int, char const*)'
globjwin.o(.text+0xeeb):/home/test/src/globjwin.cpp:73: undefined reference to `QBoxLayout::addLayout(QLayout*, int)'
globjwin.o(.text+0xf0d):/home/test/src/globjwin.cpp:74: undefined reference to `QBoxLayout::addWidget(QWidget*, int, int)'
globjwin.o(.text+0xf20):/home/test/src/globjwin.cpp:74: undefined reference to `QWidget::~QWidget()'
/usr/qt/3/include/qstring.h:847: undefined reference to `QString::shared_null'
globjwin.o(.gnu.linkonce.t._ZN7QStringD1Ev+0x2d):/usr/qt/3/include/qstring.h:848: undefined reference to `QStringData::deleteSelf()'
*** Beendet mit Status: 2 ***


My test.cpp looks like this:

Code:

#include "globjwin.h"
#include </usr/qt/3/include/qapplication.h>
#include </usr/qt/3/include/qgl.h>

/*
  The main program is here.
*/

int main( int argc, char **argv )
{
    QApplication::setColorSpec( QApplication::CustomColor );
    QApplication a(argc,argv);

    if ( !QGLFormat::hasOpenGL() ) {
 qWarning( "This system has no OpenGL support. Exiting." );
 return -1;
    }

    GLObjectWindow w;
    w.resize( 400, 350 );
    a.setMainWidget( &w );
    w.show();
    return a.exec();
}


For some reason, I always had to give the full path to the include statements, otherwise it wouldn't find the header files. I'm pretty new to C++ programming, and have NO idea where to go. Can somebody point me into the right direction please!? :-)

Tom
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Dec 14, 2004 12:44 am    Post subject: Reply with quote

Okay I came a little closer. After adding -L$QTDIR/lib -lqt-mt to the configure options in the KDevelop project settings, I no longer see the "undefined reference" to QApplication, but I still get the undefined references to all the GL stuff. Is there a similar solution to this problem. As far as I understand it the linker just doesn't find the libs it needs right? So where to I find the OpenGL libs I need for my Qt app?

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum