PDA

View Full Version : Qt Creator Linking fails on Ubuntu Karmic



kevinchannon
28th March 2010, 18:58
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::operator=(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::open(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::Data*)':
/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.

kevinchannon
29th March 2010, 09:34
OK, fixed it. The problem was between my chair and the keyboard. I had the line

QT -= core gui
in the .pro file! Making a console application, so should have just had

QT -= gui

D'oh!

Thanks anyway :)