I don't know if this is a bug in Qt or not. I re-emerged qt-3.3.3 last night to have it install the documentation. Now the HTML docs are installed. I've been giving my wife C++ lessons in our spare time, and I thought she might enjoy doing some GUI stuff. I've always used Qt for my C++ GUI projects, though I haven't worked on any since I came to Gentoo. I typed in this program straight out of my Qt 3 book:
#include <qapplication.h> #include <qlabel.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("Hello World!", 0); app.setMainWidget(label); label->show(); return app.exec(); } I ran qmake -project to get a .pro file, then qmake again to generate a Makefile. Then I ran make and got this output: g++ -c -pipe -Wall -W -O2 -march=i686 -DQT_NO_DEBUG -I/usr/qt/3/mkspecs/linux-g++ -I. -I. -I/usr/qt/3/include -o helloqt.o helloqt.cpp g++ -o qt helloqt.o -L/usr/X11R6/lib -lXext -lX11 -lm helloqt.o(.text+0x2a): In function `main': : undefined reference to `QApplication::QApplication[in-charge](int&, char**)' helloqt.o(.text+0x50): In function `main': : undefined reference to `QString::QString[in-charge](char const*)' helloqt.o(.text+0x6e): In function `main': : undefined reference to `QLabel::QLabel[in-charge](QString const&, QWidget*, char const*, unsigned)' helloqt.o(.text+0x84): In function `main': : undefined reference to `QString::shared_null' helloqt.o(.text+0x8e): In function `main': : undefined reference to `QStringData::deleteSelf()' helloqt.o(.text+0x9a): In function `main': : undefined reference to `QApplication::setMainWidget(QWidget*)' helloqt.o(.text+0xad): In function `main': : undefined reference to `QApplication::exec()' helloqt.o(.text+0xb7): In function `main': : undefined reference to `QApplication::~QApplication [in-charge]()' helloqt.o(.text+0xe0): In function `main': : undefined reference to `QString::shared_null' helloqt.o(.text+0xea): In function `main': : undefined reference to `QStringData::deleteSelf()' helloqt.o(.text+0x104): In function `main': : undefined reference to `QApplication::~QApplication [in-charge]()' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList [in-charge]()' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList [in-charge deleting]()' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)' helloqt.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const' helloqt.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection' collect2: ld returned 1 exit status make: *** [qt] Error 1 I looked over my book's source code and compared it to what I typed in and they look identical. Is this a problem with my source code or a problem with the Qt toolkit? Should I submit this as a bug? -- gentoo-user@gentoo.org mailing list