Qmake generates LIBS with wrong Qt libraries path

  • I am using Qt 5.3.2 under Ubuntu 14.04. In one perticular project, the "LIBS" variable of the Makefile generated by qmake includes the Qt libraries as follow : "-L/opt/Qt5.3.2/5.3/gcc_64/lib -lQt5XmlPatterns -lQt5Widgets -L/usr/X11R6/lib64 -lQt5Xml -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread". The 2 first libraries are searched in "/opt/Qt5.3.2/5.3/gcc_64/lib" which is expected. But the last libraries are searched in "/usr/X11R6/lib64" which doesn't even exist on the machine.
    How can this be and what controls the Qt libraries path (I have tries to use things like QMAKE_LIBDIR_QT without success).
    Thanks for your help.

  • Hello,
    I don't have any more error but I use to have one. I have to admint that there are 2 versions of Qt 5 installed on the machine, the original one (5.2.1) that comes with Ubuntu plus the 5.3.2 that I downloaded from Qt site. The problem arose when QtCreator was installed by mistake from the official Ubuntu repository (obviously targeting Qt 5.2.1). I managed to solve this by uninstalling this QtCreator and reinstalling Qt 5.3.2. I beleive that being able to target the version of Qt I which should not depend on the order in which packages are installed. So, my question remains, how can I get rid of this /usr/X11R6/lib64 path in the LIBS.

  • Lifetime Qt Champion

    You have to modify the mkspec

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.