PDA

View Full Version : Getting linker errors trying to build formerly working programs under 4.7.1



MattPhillips
22nd February 2011, 18:50
Hi,

I'm trying to compile programs that compiled unproblematically under 4.7.0, and, I've run into a series of problems. First, I got this:


make: ~/bin/uic: Command not found
make: *** [.uic/release-shared/ui_gui.h] Error 127

I solved this by finding the uic executable and putting it in ~/bin. The same thing happened with moc and was resolved the same way. But now I'm getting this:



make: Entering directory `/home/matt/Projects/PEECS/PEVS'
g++ -Wl,-rpath-link,/home/matt/lib -m64 -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-4.7.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.7.1/lib -o PEVS .obj/release-shared/main.o .obj/release-shared/pevgl.o .obj/release-shared/sock.o .obj/release-shared/ut.o .obj/release-shared/sess.o .obj/release-shared/pevobj.o .obj/release-shared/moc_pevgl.o .obj/release-shared/moc_sock.o .obj/release-shared/moc_sess.o .obj/release-shared/moc_pevobj.o -L/home/matt/lib -L/usr/X11R6/lib64 -L../fftw_build/lib -L../fftw_build/linux/lib -lfftw3 -lQtOpenGL -L/home/matt/lib -L/usr/X11R6/lib64 -lQtGui -lQtNetwork -lQtCore -lGLU -lGL -lpthread
.obj/release-shared/sock.o: In function `T.1815':
make: Leaving directory `/home/matt/Projects/PEECS/PEVS'
sock.cpp:(.text+0x3de): undefined reference to `QMetaType::registerTypedef(char const*, int)'
.obj/release-shared/sock.o: In function `T.1816':
sock.cpp:(.text+0x42e): undefined reference to `QMetaType::registerTypedef(char const*, int)'
.obj/release-shared/sess.o: In function `T.2498':
sess.cpp:(.text+0x32e): undefined reference to `QMetaType::registerTypedef(char const*, int)'
.obj/release-shared/sess.o: In function `T.2499':
sess.cpp:(.text+0x37e): undefined reference to `QMetaType::registerTypedef(char const*, int)'
.obj/release-shared/sess.o: In function `T.2500':
sess.cpp:(.text+0x3ce): undefined reference to `QMetaType::registerTypedef(char const*, int)'
.obj/release-shared/pevobj.o:pevobj.cpp:(.text+0x837): more undefined references to `QMetaType::registerTypedef(char const*, int)' follow
.obj/release-shared/pevobj.o: In function `QList<QString>::append(QString const&)':
pevobj.cpp:(.text._ZN5QListI7QStringE6appendERKS0_[QList<QString>::append(QString const&)]+0x38): undefined reference to `QListData::detach_grow(int*, int)'
collect2: ld returned 1 exit status
make: *** [PEVS] Error 1
The process "/usr/bin/make" exited with code %2.

This seems like it's 4.7.1 clashing with my previous version (4.7.0) but I haven't been able to uninstall that--the Makefiles (for make uninstall) have disappeared from the directory somehow. But anyway, is version clash the issue here? Anybody know what's up with this?

Matt

high_flyer
22nd February 2011, 20:49
you need to set QTDIR to where the root of your 4.7.1 installation is.

MattPhillips
23rd February 2011, 00:05
Hi Wiseguy, that sounds very promising but how do I set QTDIR :o? I tried looking for this within Qt documentation, and editing /etc/profile as follows


PATH=$PATH:/home/matt/qt-everywhere-opensource-src-4.7.1
export PATH
QTPATH = /home/matt/qt-everywhere-opensource-src-4.7.1
export QTPATH

and restarting, but none of this helped.

MattPhillips
23rd February 2011, 06:26
Also tried running

$ env QTPATH=/home/matt/qt-everywhere-opensource-src-4.7.1 QTDIR=/home/matt/qt-everywhere-opensource-src-4.7.1 qtcreator

and defining QTDIR, QTPATH accordingly in the .pro file, neither of these did anything.

vishwajeet.dusane
24th February 2011, 08:16
Could u paste linking error message after setting environment variable or u can check if enviornement variable is set properly by

echo $QTDIR

MattPhillips
24th February 2011, 08:41
Hi v.d.,

I don't get any error messages beyond what I showed already, even when defining QTDIR at the command prompt (so that echo $QTDIR returned the intended directory). After the other various attempts to set QTDIR described here, I would still get nothing for echo $QTDIR. Of course, I'm running qtcreator out of the <qt version 4.7.0>/bin directory, but that seems unavoidable; if I move it to <qt version 4.7.1>/bin, it won't open because it fails to find
libExtensionSystem.so.1. But anyway regardless of what directory it's in it seems like just setting QTDIR appropriately would be the better solution, but how to do this...

Matt

kolloid
26th February 2011, 21:48
Your QTDIR should probably be like this:

QTDIR=/home/matt/qt-everywhere-opensource-src-4.7.1/qt
if you have a 'qt' folder under '/home/matt/qt-everywhere-opensource-src-4.7.1'

Tom