12

I require a very simple mechanism in my application, where my project is built as a shared library '.so' or '.dll', but what I want is:

ExampleAppOne.so

I get:

libExampleAppOne.so -> libExampleAppOne.so.1.0.0
libExampleAppOne.so.1 -> libExampleAppOne.so.1.0.0
libExampleAppOne.so.1.0 -> libExampleAppOne.so.1.0.0

I don't even want the 'lib' prefix. In the .pro file, all I can do is change the INSTALLS variable (that is because my third requirement IS that the library be built in a specific directory).

Also, I have a fourth, related requirement: When I ask QLibrary to load the library, I want it to specifically search for a library in a very specific path and a library that matches the EXACT name given to it. No 'lib' prefix matching, no 'version string' searching, no looking into LD_LIBRARY_PATH...

Any help is appreciated.

Regards, rohan

Rohan Prabhu
  • 7,180
  • 5
  • 37
  • 71
  • Ok, found the solution for the 4th requirement. I must simply supply it an 'absolute path' so that it doesn't go around looking elsewhere for the libraries. Source: Qt documentation for QLibrary – Rohan Prabhu May 23 '11 at 18:27
  • can you post the makefile please ? – Abhijith May 23 '11 at 18:40

2 Answers2

7

add the following to you .pro file

# disables the lib prefix
CONFIG += no_plugin_name_prefix
# disable symlinks & versioning
CONFIG += plugin
lumos0815
  • 3,908
  • 2
  • 25
  • 25
5

Adding plugin to the CONFIG variable should disable versioning and the generation of symbolic links to the library.

I don't know of a simple way to disable the lib prefix though. You way want to dig into the provided QMake spec files to see how the default processing is implemented.

Jonathan Perret
  • 132
  • 1
  • 4
  • 3
    Also do `CONFIG += no_plugin_name_prefix` (from [here](http://lists.qt-project.org/pipermail/interest/2012-June/002798.html)). If you build a Python extension and you want to force the `.so` extension, you also need (Mac/Win) `QMAKE_EXTENSION_SHLIB = so`. – Albert Jan 31 '14 at 13:42