Results 1 to 7 of 7

Thread: Getting linker errors trying to build formerly working programs under 4.7.1

  1. #1
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Getting linker errors trying to build formerly working programs under 4.7.1

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    you need to set QTDIR to where the root of your 4.7.1 installation is.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    Hi Wiseguy, that sounds very promising but how do I set QTDIR ? 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.

  4. #4
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    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.

  5. #5
    Join Date
    Sep 2009
    Posts
    72
    Thanked 10 Times in 10 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    Could u paste linking error message after setting environment variable or u can check if enviornement variable is set properly by
    Qt Code:
    1. echo $QTDIR
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    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

  7. #7
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting linker errors trying to build formerly working programs under 4.7.1

    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

Similar Threads

  1. Linker errors with Q_OBJECT
    By dustin034 in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2010, 20:14
  2. linker errors from MinGW 4.4.0 for Qt 4.6.2
    By planetLars in forum Qt Tools
    Replies: 1
    Last Post: 15th April 2010, 21:30
  3. please help with linker errors
    By jimboqt in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2007, 10:49
  4. Linker errors!!
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2006, 09:14
  5. Linker Errors
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 7th March 2006, 19:30

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.