qmake and multiple versions of libraries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

qmake and multiple versions of libraries

donbright
qmake prepends -L/usr/lib and/or -L/usr/local/lib onto the front of
the link path. This will cause problems on systems where one version
of the library is installed on the system (/usr/lib), while another
version (often a newer version installed under $HOME) was used to
compile the openscad library. Even the OPENCGALDIR and OPENCSGDIR
commands do not override the -L/usr/lib flag.

It seems like it would take a lot of work to fix this. I am no expert
but it appears that it would require reworking all of the .pri and
.pro files to use QMAKE_LIBDIR instead of LIBS+=, because QMAKE_LIBDIR
allows you to prepend things to all of the linkflags, where as LIBS
seems to come after QMAKE_LIBDIR. But this might break other things.
There are some workarounds.

alternative 1. become root and uninstall the old versions of the
libraries. install newer versions from source

alternative 2. hack the makefile generated by qmake and re-order the
library paths to work properly on your system

For most people this probably won't be a problem. But if someone is
trying to compile the source on a machine, they can get unexplained
and strange errors.

-DB

Reply | Threaded
Open this post in threaded view
|

Re: qmake and multiple versions of libraries

kintel
Administrator

On Dec 15, 2011, at 00:44 AM, Don Bright wrote:

> qmake prepends -L/usr/lib and/or -L/usr/local/lib onto the front of
> the link path.

Oh, that's not too cool.
I think I can generalize the Mac build setup to work like that for Linux as well.
I'll play in a separate branch and give you a hint when I think it can be tested.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: qmake and multiple versions of libraries

kintel
Administrator
In reply to this post by donbright
Hi again,

Please try the branch named 'qmake'.
Set the environment variable OPENSCAD_LIBRARIES to point to the install prefix of 3rd party libraries.
This works for me on Mac and doesn't screw up my Linux build, but it needs some testing on other systems, as well as Windows. This should theoretically work on Windows as well, but ymmw.

 -Marius