Results 1 to 2 of 2

Thread: Linking fails on Ubuntu Karmic

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Linking fails on Ubuntu Karmic

    Hi,

    I've been using Qt Creator on Ubuntu for about a year or so now. I previously had a laptop with Ubuntu Hardy on it, where Qt Creator worked perfectly. I recently upgraded my laptop, installed Ubuntu Karmic and then Qt Creator (1.3.1, built on 18th Jan. 2010 from revision 8de178a067).

    On this set-up am unable to successfully produce an executable The process gets through compilation, but then fails to actually find any of the Qt libraries. The output is:

    Running build steps for project ivcc...
    Configuration unchanged, skipping QMake step.
    Starting: /usr/bin/make -w
    make: Entering directory `/home/kevin/Programs/ivcc'
    g++ -c -pipe -g -Wall -W -D_REENTRANT -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4 -I. -o main.o main.cpp
    main.cpp: In function ‘int main(int, char**)’:
    main.cpp:29: warning: unused variable ‘temp’
    main.cpp:47: warning: unused variable ‘good_conversion’
    main.cpp:48: warning: unused variable ‘previousTimePoint’
    main.cpp:48: warning: unused variable ‘blockStartTime’
    g++ -o ivcc main.o -L/usr/lib -lpthread
    main.o: In function `main':
    /home/kevin/Programs/ivcc/main.cpp:23: undefined reference to `QString:perator=(QString const&)'
    /home/kevin/Programs/ivcc/main.cpp:26: undefined reference to `QChar::QChar(char)'
    /home/kevin/Programs/ivcc/main.cpp:26: undefined reference to `QString::split(QChar const&, QString::SplitBehavior, Qt::CaseSensitivity) const'
    /home/kevin/Programs/ivcc/main.cpp:37: undefined reference to `QFile::QFile(QString const&)'
    /home/kevin/Programs/ivcc/main.cpp:38: undefined reference to `QFile:pen(QFlags<QIODevice::OpenModeFlag>)'

    ... ...

    main.o: In function `QList':
    /usr/include/qt4/QtCore/qlist.h:110: undefined reference to `QListData::shared_null'
    main.o: In function `QList<QString>::at(int) const':
    /usr/include/qt4/QtCore/qlist.h:395: undefined reference to `qt_assert_x(char const*, char const*, char const*, int)'
    main.o: In function `QList<QString>::free(QListData:ata*)':
    /usr/include/qt4/QtCore/qlist.h:562: undefined reference to `qFree(void*)'
    collect2: ld returned 1 exit status
    make: *** [ivcc] Error 1
    Exited with code 2.
    Error while building project ivcc
    When executing build step 'Make'
    The full output is interpreted as containing 16 images (??!?) by the forum, so I attached it to the post. So, it looks like it's not finding the actual libraries (which I have installed, QTDIR = /usr/share/qt4). Anyway, I'm stuck. Any suggestions or similar experiences would be really helpful, I really want to get it working again!

    Cheers.
    Attached Files Attached Files

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

    Default Re: Linking fails on Ubuntu Karmic

    OK, fixed it. The problem was between my chair and the keyboard. I had the line
    Qt Code:
    1. QT -= core gui
    To copy to clipboard, switch view to plain text mode 
    in the .pro file! Making a console application, so should have just had
    Qt Code:
    1. QT -= gui
    To copy to clipboard, switch view to plain text mode 

    D'oh!

    Thanks anyway

Similar Threads

  1. How to on Ubuntu?
    By prchakal in forum Qt Programming
    Replies: 3
    Last Post: 10th March 2010, 07:11
  2. SQL in Centos and Ubuntu
    By Lycus HackerEmo in forum Newbie
    Replies: 1
    Last Post: 6th January 2010, 01:24
  3. Qt in Ubuntu
    By impeteperry in forum General Programming
    Replies: 4
    Last Post: 30th November 2008, 02:16
  4. Hello Qt fails, KDevelop un Ubuntu
    By tksharpless in forum KDE Forum
    Replies: 3
    Last Post: 31st August 2008, 03:20
  5. qt debug on ubuntu
    By yaron in forum Installation and Deployment
    Replies: 4
    Last Post: 3rd March 2008, 23:17

Tags for this Thread

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.