Qt Programming Help


Recommended Posts

ok I am giving qt a try when it comes to programing.. but for the life of me I can not get anything to compile..

here is my first program

#include <qapplication.h>
#include <qpushbutton.h>

int main( int argc, char **argv )
{

QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();

}

bash-2.05b$ cd /mnt/maxtor3/programing/qt
bash-2.05b$ ls
Makefile  qt.pro  rr  temp  test.cpp  test.o
bash-2.05b$ make
g++  -o qt test.o    -L/usr/X11R6/lib -lXext -lX11 -lm
test.o(.text+0x2c): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::QWidget[not-in-charge](QWidget*, char const*, unsigned)'
test.o(.text+0x51): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::setMinimumSize(int, int)'
test.o(.text+0x69): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::setMaximumSize(int, int)'
test.o(.text+0x8e): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::QString[in-charge](char const*)'
test.o(.text+0xa6): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
test.o(.text+0xbe): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0xc8): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x103): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::QString[in-charge](char const*)'
test.o(.text+0x12a): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QFont::QFont[in-charge](QString const&, int, int, bool)'
test.o(.text+0x144): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QFont::~QFont [in-charge]()'
test.o(.text+0x158): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x162): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x167): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `qApp'
test.o(.text+0x183): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
test.o(.text+0x1a6): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x1b0): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x1c0): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.text+0x1df): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QFont::~QFont [in-charge]()'
test.o(.text+0x1f3): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x1fd): In function `MyWidget::MyWidget[not-in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x238): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::QWidget[not-in-charge](QWidget*, char const*, unsigned)'
test.o(.text+0x25d): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::setMinimumSize(int, int)'
test.o(.text+0x275): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::setMaximumSize(int, int)'
test.o(.text+0x29a): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::QString[in-charge](char const*)'
test.o(.text+0x2b2): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
test.o(.text+0x2ca): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x2d4): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x30f): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::QString[in-charge](char const*)'
test.o(.text+0x336): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QFont::QFont[in-charge](QString const&, int, int, bool)'
test.o(.text+0x350): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QFont::~QFont [in-charge]()'
test.o(.text+0x364): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x36e): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x373): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `qApp'
test.o(.text+0x38f): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*)'
test.o(.text+0x3b2): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x3bc): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x3cc): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.text+0x3eb): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QFont::~QFont [in-charge]()'
test.o(.text+0x3ff): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QString::shared_null'
test.o(.text+0x409): In function `MyWidget::MyWidget[in-charge](QWidget*, char const*)':
: undefined reference to `QStringData::deleteSelf()'
test.o(.text+0x448): In function `main':
: undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
test.o(.text+0x488): In function `main':
: undefined reference to `QWidget::setGeometry(int, int, int, int)'
test.o(.text+0x494): In function `main':
: undefined reference to `QApplication::setMainWidget(QWidget*)'
test.o(.text+0x49c): In function `main':
: undefined reference to `QWidget::show()'
test.o(.text+0x4a4): In function `main':
: undefined reference to `QApplication::exec()'
test.o(.text+0x4c2): In function `main':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.text+0x4ca): In function `main':
: undefined reference to `QApplication::~QApplication [in-charge]()'
test.o(.text+0x4f7): In function `main':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.text+0x4ff): In function `main':
: undefined reference to `QApplication::~QApplication [in-charge]()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xc): undefined reference to `QWidget::className() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x10): undefined reference to `QWidget::qt_cast(char const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x14): undefined reference to `QWidget::qt_invoke(int, QUObject*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x18): undefined reference to `QWidget::qt_emit(int, QUObject*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1c): undefined reference to `QWidget::qt_property(int, int, QVariant*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x28): undefined reference to `QWidget::event(QEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x2c): undefined reference to `QObject::eventFilter(QObject*, QEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x30): undefined reference to `QWidget::setName(char const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x34): undefined reference to `QObject::insertChild(QObject*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x38): undefined reference to `QObject::removeChild(QObject*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x3c): undefined reference to `QObject::setProperty(char const*, QVariant const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x40): undefined reference to `QObject::property(char const*) const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x44): undefined reference to `QObject::timerEvent(QTimerEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x48): undefined reference to `QObject::childEvent(QChildEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x4c): undefined reference to `QObject::customEvent(QCustomEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x50): undefined reference to `QObject::connectNotify(char const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x54): undefined reference to `QObject::disconnectNotify(char const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x58): undefined reference to `QObject::checkConnectArgs(char const*, QObject const*, char const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x5c): undefined reference to `QWidget::setEnabled(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x60): undefined reference to `QWidget::setMinimumSize(int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x64): undefined reference to `QWidget::setMaximumSize(int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x68): undefined reference to `QWidget::setSizeIncrement(int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x6c): undefined reference to `QWidget::setBackgroundMode(Qt::BackgroundMode)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x70): undefined reference to `QWidget::setEraseColor(QColor const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x74): undefined reference to `QWidget::setErasePixmap(QPixmap const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x78): undefined reference to `QWidget::setPalette(QPalette const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x7c): undefined reference to `QWidget::setPaletteBackgroundColor(QColor const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x80): undefined reference to `QWidget::setPaletteBackgroundPixmap(QPixmap const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x84): undefined reference to `QWidget::setFont(QFont const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x88): undefined reference to `QWidget::setCursor(QCursor const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x8c): undefined reference to `QWidget::unsetCursor()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x90): undefined reference to `QWidget::setMask(QBitmap const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x94): undefined reference to `QWidget::setMask(QRegion const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x98): undefined reference to `QWidget::setBackgroundColor(QColor const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x9c): undefined reference to `QWidget::setBackgroundPixmap(QPixmap const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xa0): undefined reference to `QWidget::setCaption(QString const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xa4): undefined reference to `QWidget::setIcon(QPixmap const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xa8): undefined reference to `QWidget::setIconText(QString const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xac): undefined reference to `QWidget::setMouseTracking(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xb0): undefined reference to `QWidget::setFocus()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xb4): undefined reference to `QWidget::setActiveWindow()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xb8): undefined reference to `QWidget::setFocusPolicy(QWidget::FocusPolicy)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xbc): undefined reference to `QWidget::setFocusProxy(QWidget*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xc0): undefined reference to `QWidget::setUpdatesEnabled(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xc4): undefined reference to `QWidget::show()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xc8): undefined reference to `QWidget::hide()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xcc): undefined reference to `QWidget::showMinimized()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xd0): undefined reference to `QWidget::showMaximized()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xd4): undefined reference to `QWidget::showNormal()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xd8): undefined reference to `QWidget::polish()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xdc): undefined reference to `QWidget::move(int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xe0): undefined reference to `QWidget::resize(int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xe4): undefined reference to `QWidget::setGeometry(int, int, int, int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xec): undefined reference to `QWidget::close(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xf0): undefined reference to `QWidget::sizeHint() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xf4): undefined reference to `QWidget::minimumSizeHint() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xf8): undefined reference to `QWidget::sizePolicy() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0xfc): undefined reference to `QWidget::setSizePolicy(QSizePolicy)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x100): undefined reference to `QWidget::heightForWidth(int) const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x104): undefined reference to `QWidget::adjustSize()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x108): undefined reference to `QWidget::reparent(QWidget*, unsigned, QPoint const&, bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x10c): undefined reference to `QWidget::setAcceptDrops(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x110): undefined reference to `QWidget::setAutoMask(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x114): undefined reference to `QWidget::setBackgroundOrigin(QWidget::BackgroundOrigin)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x118): undefined reference to `QWidget::customWhatsThis() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x11c): undefined reference to `QWidget::mousePressEvent(QMouseEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x120): undefined reference to `QWidget::mouseReleaseEvent(QMouseEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x124): undefined reference to `QWidget::mouseDoubleClickEvent(QMouseEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x128): undefined reference to `QWidget::mouseMoveEvent(QMouseEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x12c): undefined reference to `QWidget::wheelEvent(QWheelEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x130): undefined reference to `QWidget::keyPressEvent(QKeyEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x134): undefined reference to `QWidget::keyReleaseEvent(QKeyEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x138): undefined reference to `QWidget::focusInEvent(QFocusEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x13c): undefined reference to `QWidget::focusOutEvent(QFocusEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x140): undefined reference to `QWidget::enterEvent(QEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x144): undefined reference to `QWidget::leaveEvent(QEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x148): undefined reference to `QWidget::paintEvent(QPaintEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x14c): undefined reference to `QWidget::moveEvent(QMoveEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x150): undefined reference to `QWidget::resizeEvent(QResizeEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x154): undefined reference to `QWidget::closeEvent(QCloseEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x158): undefined reference to `QWidget::contextMenuEvent(QContextMenuEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x15c): undefined reference to `QWidget::imStartEvent(QIMEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x160): undefined reference to `QWidget::imComposeEvent(QIMEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x164): undefined reference to `QWidget::imEndEvent(QIMEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x168): undefined reference to `QWidget::tabletEvent(QTabletEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x16c): undefined reference to `QWidget::dragEnterEvent(QDragEnterEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x170): undefined reference to `QWidget::dragMoveEvent(QDragMoveEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x174): undefined reference to `QWidget::dragLeaveEvent(QDragLeaveEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x178): undefined reference to `QWidget::dropEvent(QDropEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x17c): undefined reference to `QWidget::showEvent(QShowEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x180): undefined reference to `QWidget::hideEvent(QHideEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x184): undefined reference to `QWidget::x11Event(_XEvent*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x188): undefined reference to `QWidget::updateMask()'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x18c): undefined reference to `QWidget::styleChange(QStyle&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x190): undefined reference to `QWidget::enabledChange(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x194): undefined reference to `QWidget::paletteChange(QPalette const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x198): undefined reference to `QWidget::fontChange(QFont const&)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x19c): undefined reference to `QWidget::windowActivationChange(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1a0): undefined reference to `QWidget::metric(int) const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1a4): undefined reference to `QWidget::create(unsigned long, bool, bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1a8): undefined reference to `QWidget::destroy(bool, bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1b4): undefined reference to `QWidget::focusNextPrevChild(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1b8): undefined reference to `QWidget::setKeyCompression(bool)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1bc): undefined reference to `QWidget::setMicroFocusHint(int, int, int, int, bool, QFont*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1d0): undefined reference to `QPaintDevice::setResolution(int)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1d4): undefined reference to `QPaintDevice::resolution() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1d8): undefined reference to `QPaintDevice::handle() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1dc): undefined reference to `QPaintDevice::x11RenderHandle() const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1e0): undefined reference to `QPaintDevice::setX11Data(QPaintDeviceX11Data const*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1e4): undefined reference to `QPaintDevice::cmd(int, QPainter*, QPDevCmdParam*)'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1e8): undefined reference to `non-virtual thunk [nv:-40] to QWidget::metric(int) const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1ec): undefined reference to `QPaintDevice::fontMet(QFont*, int, char const*, int) const'
test.o(.gnu.linkonce.r._ZTV8MyWidget+0x1f0): undefined reference to `QPaintDevice::fontInf(QFont*, int) const'
test.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
test.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList [in-charge]()'
test.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList [in-charge deleting]()'
test.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
test.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
test.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
test.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
test.o(.gnu.linkonce.t._ZNK7QWidget10metaObjectEv+0x5): In function `QWidget::metaObject() const':
: undefined reference to `QWidget::staticMetaObject()'
test.o(.gnu.linkonce.t._ZN8MyWidgetD0Ev+0x1d): In function `MyWidget::~MyWidget [in-charge deleting]()':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.gnu.linkonce.t._ZN8MyWidgetD1Ev+0x1a): In function `MyWidget::~MyWidget [in-charge]()':
: undefined reference to `QWidget::~QWidget [not-in-charge]()'
test.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
test.o(.gnu.linkonce.r._ZTI8MyWidget+0x8): undefined reference to `typeinfo for QWidget'
collect2: ld returned 1 exit status
make: *** [qt] Error 1

Link to post
Share on other sites

ok this is why I post this stuff. I alwyas find my answer 10 min later.

my make file created by qmake is incorrect.. I also needed to create a env variable called QTDIR which pointed to /usr/qt/3

and add a linking -lqt

along with my lib was wrong.. qmake said it was in /usr/X11R6/lib but it was in /usr/qt/3/lib

this command showed me what to do

g++ -Wall -I/usr/qt/3/include -L/usr/qt/3/lib test.cpp -o hello -lqt

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...