Results 1 to 3 of 3
hi
is there anyone who can help me out with programming in Qt 3.3
g++ -o qt qt.cpp -I$QTDIR/include -L$QTDIR/lib -lqt
/usr/bin/ld: cannot find -lqt
collect2: ld returned 1 exit ...
- 03-07-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 12
help about Qt3.3
hi
is there anyone who can help me out with programming in Qt 3.3
g++ -o qt qt.cpp -I$QTDIR/include -L$QTDIR/lib -lqt
/usr/bin/ld: cannot find -lqt
collect2: ld returned 1 exit status
program is:
#include<qapplication.h>
#include<qmainwindow.h>
int main(int agc,char **avr)
{
QApplication app(agc,avr);
QMainWindow *m=new QMainWindow();
app.setMainWidget(m);
m->show();
return app.exec();
}
----------------------------------------------------------------
thanks in advance
- 03-07-2009 #2Linux Newbie
- Join Date
- Feb 2009
- Location
- Third ring of Pergatory
- Posts
- 199
Did you mean to put a space between "lib" and "-lgt"? The linker sees -lgt as a file, or at least this message/lib -lqt
indicates that/usr/bin/ld: cannot find -lqt
- 03-09-2009 #3Just Joined!
- Join Date
- Mar 2009
- Posts
- 12
tried g++ -o qt qt.cpp -I$QTDIR/include -L$QTDIR/lib-lqt
the compiler throws this:
/tmp/ccVh1rQj.o: In function `main':
qt.cpp: (.text+0x24): undefined reference to `QApplication::QApplication(int&, char**)'
qt.cpp: (.text+0x56): undefined reference to `QMainWindow::QMainWindow(QWidget*, char const*, unsigned int)'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0xc): undefined reference to `QGList::clear()'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0x10): undefined reference to `QGList::~QGList()'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0x14): undefined reference to `QGList::~QGList()'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0x18 ): undefined reference to `QPtrCollection::newItem(void*)'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0x20): undefined reference to `QGList::compareItems(void*, void*)'
/tmp/ccVh1rQj.o: (.rodata._ZTV6QGList[vtable for QGList]+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
collect2: ld returned 1 exit status
not a bit easy to understand


Reply With Quote