Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    12

    Question 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

  2. #2
    Linux Newbie
    Join Date
    Feb 2009
    Location
    Third ring of Pergatory
    Posts
    199
    /lib -lqt
    Did you mean to put a space between "lib" and "-lgt"? The linker sees -lgt as a file, or at least this message
    /usr/bin/ld: cannot find -lqt
    indicates that

  3. #3
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...