Results 1 to 4 of 4

Thread: Qt linking problem

  1. #1
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Red face Qt linking problem

    Lets see if I can give enough information for someone to point out the glaring issue I have.
    Firstly a list of the weird aspects of how I'm trying to work currently:
    Qt package I'm using: qt-embedded-linux-opensource-src-4.5.0 (trying to use Qt on a small embedded arm linux platform,
    Qt compilation setup: Ubuntu x86-64, cross compilation tool chain supplied by Technologic Systems with the system I am targeting. The tool chain binaries path is added to the start of the $PATH before I try to ./configure and compile. The programs in that folder have all been renamed "arm-linux-*" so that the Qt scripts see them.
    Qt linking setup: Windows using Eclipse as supplied by Technologic Systems using the same cross compilation tool chain, this setup has worked and linked other non trivial but smaller libraries.
    ./configure options:
    Qt Code:
    1. ./configure -embedded arm -xplatform qws/linux-arm-g++ -little-endian -L /data/TS-7800/devel-tools/crosstool-lin/arm-none-linux-gnueabi/sys-root/usr/lib/ -static -stl -silent -prefix /data/TS-7800/LibBuild/Output
    To copy to clipboard, switch view to plain text mode 
    nice and boring call to make: make -j 12
    the ./configure and make have a few warnings but nothing I've noticed that is scary and no errors.

    So now I move the includes folder from the -prefix folder to where I'm including things from in Windows, and the lib folder to where I've got Eclipse looking for library files. This appears to make sense to me and should to my simple mind be what I need.

    All of my code compiles, and the linker can find the library files and the link command looks like:
    Qt Code:
    1. arm-none-linux-gnueabi-g++.exe -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSat\Link -LC:\Eclipse\workspace\Library\Debug -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSat -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSatLib\inc -static -oGPSat src\UDPTest.o -lQt3Support -lQtCore -lQtGui -lQtNetwork -lQtScript -lQtScriptTools -lQtSql -lQtSvg -lQtTest -lQtWebKit -lQtXml -lGPSat -lsolid
    To copy to clipboard, switch view to plain text mode 
    With the first segment of errors looking like:
    Qt Code:
    1. C:\Eclipse\workspace\Library\Debug\libGPSat.a(GUDPChannel.o): In function `GUDPChannel':..\src/GUDPChannel.cpp:4: undefined reference to `QObject::QObject(QObject*)'
    2. :..\src/GUDPChannel.cpp:4: undefined reference to `QUdpSocket::QUdpSocket(QObject*)'
    3. :..\src/GUDPChannel.cpp:6: undefined reference to `qFlagLocation(char const*)'
    4. :..\src/GUDPChannel.cpp:6: undefined reference to `qFlagLocation(char const*)'
    5. :..\src/GUDPChannel.cpp:6: undefined reference to `QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType)'
    6. :..\src/GUDPChannel.cpp:6: undefined reference to `QUdpSocket::~QUdpSocket()'
    7. :..\src/GUDPChannel.cpp:6: undefined reference to `QObject::~QObject()'
    8. :..\src/GUDPChannel.cpp:8: undefined reference to `vtable for GUDPChannel'
    9. :..\src/GUDPChannel.cpp:4: undefined reference to `QObject::QObject(QObject*)'
    10. :..\src/GUDPChannel.cpp:4: undefined reference to `QUdpSocket::QUdpSocket(QObject*)'
    To copy to clipboard, switch view to plain text mode 
    using the objdump tool I can see that the .a files used for the linking contain lots of stuff (there size also shows this ~195meg for the lib folder) and that QObject is mentioned in them. There appears to be way to much stuff for me to determine what exsactly is in there, but I feel that the files contain definitions for the above errors. So I'm a bit perplexed.

    I'm not compiling Qt on windows because the environment can't manage to do the 'compiling qmake' step of the ./configure script.
    I'm using static linking because the Linux environment were using is configured for old eabi format but we want the better FPU performance of the gnueabi option. (yes I'm aware of the legal implications of LGPL + static linking) This calling convention issue may be what my problem is.

    Can anyone give me some help on this? Despite the large amount of data I've put here I'm sure I haven't mentioned something of importance and will strive to make it as easy as possible for people to help me.

  2. #2
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt linking problem

    No help guys? Is this the wrong forum for this?

  3. #3
    Join Date
    Aug 2008
    Posts
    11
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt linking problem

    About getting your Qt setup on Windows, FIRST open the Windows Visual Studio Command Prompt (not just a regular command prompt), then CD /D C:\Qt\4.5.0, then run 'configure', then after 15 minutes run 'nmake', after 4 hours you are done. Then you are ready to compile on Windows.

  4. #4
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt linking problem

    Thanks for reminding me to post a follow up.
    Quote Originally Posted by LovesTha View Post
    All of my code compiles, and the linker can find the library files and the link command looks like:
    Qt Code:
    1. arm-none-linux-gnueabi-g++.exe -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSat\Link -LC:\Eclipse\workspace\Library\Debug -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSat -LC:\Eclipse\devel-tools\crosstool-win\arm-none-linux-gnueabi\GPSatLib\inc -static -oGPSat src\UDPTest.o -lQt3Support -lQtCore -lQtGui -lQtNetwork -lQtScript -lQtScriptTools -lQtSql -lQtSvg -lQtTest -lQtWebKit -lQtXml -lGPSat -lsolid
    To copy to clipboard, switch view to plain text mode 
    Apparently its pretty obvious that I have my libraries loading in the wrong order so, with that fixed (and trimmed down to the correct list) everything is linking perfectly.
    Quote Originally Posted by Antebios View Post
    About getting your Qt setup on Windows, FIRST open the Windows Visual Studio Command Prompt (not just a regular command prompt), then CD /D C:\Qt\4.5.0, then run 'configure', then after 15 minutes run 'nmake', after 4 hours you are done. Then you are ready to compile on Windows.
    FIRST: `open /dev/eyes`
    SECOND: `cat originalPost > /usr/bin/problemParser`

    Your instructions failed to notice anything about what I was doing, which is pretty far from downloading Qt for windows and compiling it in Visual Studio.
    Thank you for the poke though.
    Last edited by LovesTha; 30th March 2009 at 23:32. Reason: spelling error

Similar Threads

  1. linking problem (ffmpeg)
    By kralyk in forum Qt Programming
    Replies: 2
    Last Post: 13th April 2009, 07:35
  2. problem with order of libs during linking
    By minimax in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 10:32
  3. Linking problem on Mac os x 10.4
    By maverick_pol in forum General Programming
    Replies: 0
    Last Post: 6th January 2008, 14:09
  4. why linking problem with QGLWidget???
    By Shuchi Agrawal in forum Newbie
    Replies: 17
    Last Post: 16th March 2007, 10:45
  5. Runtime dynamic linking + Qt4 problem
    By _Ramirez_ in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2006, 14:28

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.