Results 1 to 3 of 3

Thread: Compiling error

  1. #1
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Compiling error

    Hello, I am new to qt and wanted to make a little program. I tried the tutorials at doc.trolltech.com and everything was fine. but then I tried to compile a tutorial file and I got lots of errors that didn't make sense to me and then I tried to compile the "Hello World" and I still got errors. Then I tried to un- and re-install things but nothing changed. I made a complete reinstall of fedora core 6 installed qt and now I still get errors

    It is this tutorial
    I save it as .cpp
    and in console type
    qmake -project
    qmake
    make

    and then get:
    g++ -o qt qt.o -lXext -lX11 -lm
    qt.o: In function `main':
    /home/foobar/qt/qt.cpp:13: undefined reference to `QApplication::QApplication(int&, char**)'
    /home/foobar/qt/qt.cpp:15: undefined reference to `QString::QString(char const*)'
    /home/foobar/qt/qt.cpp:15: undefined reference to `QPushButton::QPushButton(QString const&, QWidget*, char const*)'
    qt.o: In function `~QString':
    /usr/lib64/qt-3.3/include/qstring.h:847: undefined reference to `QString::shared_null'
    /usr/lib64/qt-3.3/include/qstring.h:848: undefined reference to `QStringData::deleteSelf()'
    qt.o: In function `main':
    /home/foobar/qt/qt.cpp:16: undefined reference to `QPushButton::resize(int, int)'
    /home/foobar/qt/qt.cpp:18: undefined reference to `QApplication::setMainWidget(QWidget*)'
    /home/foobar/qt/qt.cpp:19: undefined reference to `QWidget::show()'
    /home/foobar/qt/qt.cpp:20: undefined reference to `QApplication::exec()'
    /home/foobar/qt/qt.cpp:20: undefined reference to `QPushButton::~QPushButton()'
    /home/foobar/qt/qt.cpp:20: undefined reference to `QApplication::~QApplication()'
    qt.o: In function `~QString':
    /usr/lib64/qt-3.3/include/qstring.h:847: undefined reference to `QString::shared_null'
    /usr/lib64/qt-3.3/include/qstring.h:848: undefined reference to `QStringData::deleteSelf()'
    qt.o: In function `main':
    /home/foobar/qt/qt.cpp:20: undefined reference to `QApplication::~QApplication()'
    /home/foobar/qt/qt.cpp:20: undefined reference to `QPushButton::~QPushButton()'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x18): undefined reference to `QGList::clear()'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x20): undefined reference to `QGList::~QGList()'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x28): undefined reference to `QGList::~QGList()'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x30): undefined reference to `QPtrCollection::newItem(void*)'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x40): undefined reference to `QGList::compareItems(void*, void*)'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x48): undefined reference to `QGList::read(QDataStream&, void*&)'
    qt.o:(.rodata._ZTV6QGList[vtable for QGList]+0x50): undefined reference to `QGList::write(QDataStream&, void*) const'
    qt.o:(.rodata._ZTI6QGList[typeinfo for QGList]+0x10): undefined reference to `typeinfo for QPtrCollection'
    collect2: ld returned 1 exit status
    make: *** [qt] Error 1

    Anybody have an idea what's wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling error

    Add "TARGET = something" to your .pro file or rename it to something other than qt.pro and run "qmake && make".

  3. The following user says thank you to jacek for this useful post:

    Foobar (17th March 2007)

  4. #3
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Compiling error

    Thank you
    This worked with and without renaming the pro file

Similar Threads

  1. Installation on Fedora Core 4
    By jcr in forum Installation and Deployment
    Replies: 3
    Last Post: 29th January 2009, 01:34
  2. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31
  3. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  4. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.