Results 1 to 7 of 7

Thread: Problem with QMAKESPEC

  1. #1
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with QMAKESPEC

    I have to compile project to 32-bit platform on OpenSuse 11.4 x86_64.
    I set qmake options: -r -spec linux-g++-32.
    Compiler is linking libs rom /usr/lib64 instead of /usr/lib returning errors:
    Qt Code:
    1. g++ -m32 -o test-32 main.o mainwindow.o moc_mainwindow.o -L/usr/lib64 -lQtSql -L/usr/lib64 -lQtGui -L/usr/X11R6/lib64 -lQtCore -lpthread
    2. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtSql.so when searching for -lQtSql
    3. make: Opuszczenie katalogu `/home/neon/workspace/qt4/test-32-build-desktop'
    4. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtSql.so when searching for -lQtSql
    5. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtSql.so when searching for -lQtSql
    6. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtSql.so when searching for -lQtSql
    7. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lQtSql
    8. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtGui.so when searching for -lQtGui
    9. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtGui.so when searching for -lQtGui
    10. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtGui.so when searching for -lQtGui
    11. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtGui.so when searching for -lQtGui
    12. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lQtGui
    13. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtCore.so when searching for -lQtCore
    14. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtCore.so when searching for -lQtCore
    15. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../libQtCore.so when searching for -lQtCore
    16. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libQtCore.so when searching for -lQtCore
    17. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lQtCore
    18. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libpthread.so when searching for -lpthread
    19. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libpthread.a when searching for -lpthread
    20. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libpthread.so when searching for -lpthread
    21. /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libpthread.a when searching for -lpthread
    To copy to clipboard, switch view to plain text mode 
    I have installed 32-bit qt4 libs. How to build 32-bit app on 64-bit system?

    PS: On second computer with fedora everything is working correct.

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QMAKESPEC

    I'm not familiar with using qmake options to accomplish this. I've always set the QMAKESPEC environment variable to whatever spec I wanted - in this case, I'd set it to 'linux-g++-32'. Try that and see if it makes a difference.

  3. #3
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with QMAKESPEC

    I had remove qmake option and set QMAKESPEC and with simple test app it works.
    When I'm linking external library, compiled for i386 architecture, I'm getting error:
    Qt Code:
    1. :: error: i386 architecture of input file `/home/path to lib/libdr.a(libdr.o)' is incompatible with i386:x86-64 output
    To copy to clipboard, switch view to plain text mode 
    Last edited by porterneon; 8th April 2011 at 23:46.

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QMAKESPEC

    Do a 'make clean' on your project; you probably have some previously compiled 64-bit object files in it.

  5. #5
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with QMAKESPEC

    I made "make clean". Did not help.

  6. #6
    Join Date
    Jul 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QMAKESPEC

    Hi, sorry to resurrect such an old post, but I just encountered the very same problem: forcing a 32-bit compilation on a 64-bit machine using -spec linux-g++-32 still uses /usr/lib64 as main library linking path, instead of /usr/lib, which leads to linking problems. I guess it's a bug in spec files or something, and which maybe has been yet solved as the machine I experienced this had a fairly old setup (qmake 4.3.4).

    Anyway, for sake of documentation and just in case anyone else stumbles over the same problem, I found a possible workaround, which is adding also QMAKE_LIBDIR=/usr/lib parameter to qmake command line. Although this doesn't remove /usr/lib64 from linking path, at least /usr/lib is inserted BEFORE it, so linker finds first the 32 bit libraries and uses them.

    Kind regards.

  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with QMAKESPEC

    If you use the 32-bit qmake from your 32-bit build of Qt then you should get a 32-bit result by default. Are you getting this result using the 32-bit qmake?

Similar Threads

  1. QMAKESPEC has not been configured
    By karthik in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 18th November 2007, 17:54
  2. Replies: 1
    Last Post: 4th July 2007, 16:26
  3. QMAKESPEC has not been set
    By jivanr in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2007, 17:00
  4. How to set QMAKESPEC ??
    By Shuchi Agrawal in forum Qt Programming
    Replies: 14
    Last Post: 14th March 2007, 09:23
  5. what is this QMAKESPEC and hw to set it?
    By neomax in forum Qt Programming
    Replies: 2
    Last Post: 13th March 2007, 07:04

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.