Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.1
-
None
-
Linux Ubuntu 9.10
-
752cb767d4f50f43b0c69d068a0b217f05d99625
Description
According to the documentation (http://qt.nokia.com/doc/4.6/qmake-variable-reference.html#qmake-lflags-rpath), the QMAKE_LFLAGS_RPATH option in project files is:
=================
QMAKE_LFLAGS_RPATH
This is used on Unix platforms only.
Library paths in this definition are added to the executable at link time so that the added paths will be preferentially searched at runtime.
=================
Appending paths to QMAKE_LFLAGS_RPATH has the effect of inserting a space between the link flag (-Wl,-rpath,) and the path, which breaks the linker. Example:
[in project file]
QMAKE_LFLAGS_RPATH += /my/path
[in build output]
g++ -Wl,-rpath, /my/path /opt/qtsdk-2010.01/qt/lib -o [object files...]
/usr/bin/ld: /my/path: No such file: File format not recognized
A work-around is to use QMAKE_LFLAGS_DEBUG and QMAKE_LFLAGS_RELEASE to add the full RPATH option, without the spaces
QMAKE_LFLAGS_DEBUG += "-Wl,-rpath,/my/path"
QMAKE_LFLAGS_RELEASE += "-Wl,-rpath,/my/path"