Results 1 to 2 of 2

Thread: QMake for Linux x64 doesn't set -L/usr/lib64

  1. #1
    Join Date
    Feb 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QMake for Linux x64 doesn't set -L/usr/lib64

    Hi folks,

    I need two custom local installations of Qt to build 32bit and 64bit applications on Linux. The Linux distribution itself is 64bit.

    I compiled the 32bit QT as follows:
    Qt Code:
    1. ./configure -prefix /usr/local/Trolltech/Qt-4.7.2-32/ -opensource -fast -qt-sql-sqlite -no-qt3support -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-libpng -qt-libtiff -qt-libjpeg -nomake demos -nomake examples -fontconfig -platform linux-g++-32 -silent
    To copy to clipboard, switch view to plain text mode 

    and the 64bit as follows:
    Qt Code:
    1. ./configure -prefix /usr/local/Trolltech/Qt-4.7.2-64/ -opensource -fast -qt-sql-sqlite -qt-sql-mysql -no-qt3support -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-libpng -qt-libtiff -qt-libjpeg -nomake demos -nomake examples -fontconfig -platform linux-g++-64 -silent
    To copy to clipboard, switch view to plain text mode 

    The 32bit Qt works as expected and builds everything with -m32 option and links against /usr/lib so 32bit applications build flawlessly.

    However, when using the 64bit qmake, it builds with -m64 as expected, but the linker path is not added -L/usr/lib64 and hence, when it tries to link pthread, this fails because libpthread.a in /usr/lib is of 32bit architecture. Only when I manually add -L/usr/lib64 to the Makefile, the build suceeds.

    I sense an error in the makespecs.

    Q1: How do I fix this in this installation? Edit mkspecs/linux-g++-64/ manually?
    Q2: Why did this happen in the first place? Did I configure something wrong?

    Philipp

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMake for Linux x64 doesn't set -L/usr/lib64

    Quote Originally Posted by PhilippM View Post
    I sense an error in the makespecs.
    No, the specs is fine. The problem is with your compiler.

    Q1: How do I fix this in this installation? Edit mkspecs/linux-g++-64/ manually?
    Teach your compiler that when it builds in 64bit mode it should look for libraries in /usr/lib64

    Q2: Why did this happen in the first place? Did I configure something wrong?
    /usr/lib is the default place for searching for libraries so it is not added by QMake to the Makefile (you can grep the mkspecs directory to verify that). What makes this path default is the settings of your compiler - on another installation the default might be /usr/i-like-my-system-very-much or something similar. Apparently your system's 64bit environment is somehow misconfigured so it's better to fix it there. Of course editing the specs file manually might also fix the issue but then it wouldn't remove /usr/lib from the search path so you might end up with a mix of 64 and 32 bit libraries which is not what you want.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. why on Linux ,doesn't work?
    By maider in forum Qt Programming
    Replies: 5
    Last Post: 11th March 2010, 08:57
  2. qmake doesn't respect QMAKESPEC variable
    By piotr.dobrogost in forum Installation and Deployment
    Replies: 5
    Last Post: 19th July 2009, 22:08
  3. QRubberBand doesn't show (X11/Linux)
    By QwertyManiac in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2008, 22:58
  4. program doesn't seem to free memory, linux
    By JeanC in forum Qt Programming
    Replies: 5
    Last Post: 1st September 2008, 12:06
  5. qmake multiple INCLUDEPATH in Linux
    By rajeshs in forum Qt Programming
    Replies: 12
    Last Post: 15th November 2007, 10:38

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.