[Interest] Best practice to packages on Ubuntu with QtIF

Nikos Chantziaras realnc at gmail.com
Mon Feb 22 08:26:40 CET 2016


That doesn't do anything useful. It just uses an absolute path. If you 
move the executable to a different directory, it stops working.

You can verify that by looking at the Makefile. For example, here, this:

   QMAKE_RPATHDIR += ${ORIGIN}

becomes:

   -Wl,-rpath,/home/realnc/projects/myapp/

Which is completely useless.

Do do what you want, you really need to pass the string "$ORIGIN" to the 
linker:

   QMAKE_LFLAGS += -Wl,-rpath,\$\$ORIGIN

This results in:

   -Wl,-rpath,$ORIGIN

in the Makefile.


On 22/02/16 09:13, Igor Mironchik wrote:
> Hi,
>
> Got it:
>
> QMAKE_RPATHDIR += ${ORIGIN}
>
> On 22.02.2016 10:11, Nikos Chantziaras wrote:
>> On 22/02/16 08:55, Igor Mironchik wrote:
>>> On 22.02.2016 09:22, Koehne Kai wrote:
>>>>
>>>> You should rather utilize rpath, and set it e.g. to $ORIGIN
>>>>
>>>> https://en.wikipedia.org/wiki/Rpath
>>>
>>> Interesting, but "QMAKE_RPATHDIR += ." doesn't work. It require full
>>> path to work correctly...
>>
>> qmake doesn't support it. You have to do it by hand:
>>
>>   QMAKE_LFLAGS += -Wl,-rpath,\$\$ORIGIN/libs
>>
>> And then I put all libraries in the "lib" directory of the execututable.
>>
>> (And this is obviously linker and platform specific.)
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>





More information about the Interest mailing list