Author Topic: Issue with linking to specific version of shared library on Linux  (Read 3415 times)

Noltar

  • Guest
Here's my situation... I have a custom built installation of QT 4.5 in my development directory for my own shared library to build against (I'm using some 4.5 only features), but I have QT 4.4 installed on the system for the various apps that use it. That should be no problem, but it is. I have added the directories where my 4.5 libraries are located to my Linker Search Path settings for the project, and have changed the settings for both linker and compiler to use only the target settings. I've tried adding the libraries to Linker Settings both as just the specname (e.g. QtCore) and as an explicit full path and file name (e.g. ../libs/libQtCore.so.4.5.0). I've verified by having the full command line output printed when building that it is passing the correct -L options as well as -l<specname> or filename to ld. In all cases, when I run ldd on my resulting .so (which I also verify is being rebuilt by cleaning the output directory and manually confirming it is empty before building) it shows the link dependencies as being /usr/lib/libQtCore.so.4, which are symlinked to the 4.4 versions of the libraries in /usr/lib. The problem with this is that when I attempt to link my executable against my shared library, the linker of course complains about undefined references to the methods and classes I use from Qt 4.5, because it's looking up the symbols in the 4.4 versions.

Does anyone happen to have any idea about what the issue may be?

Thanks in advance!