Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid having version numbers in .so file name

I'm trying to build a dynamic library on Linux using qmake. Here is my .pro file:

TEMPLATE = lib
TARGET = sqxUiBase
QT += core gui   
CONFIG += dll    
INCLUDEPATH += ../../public/include   
DEPENDPATH += .
UI_DIR += ../GeneratedFiles    
RCC_DIR += ../GeneratedFiles   
CONFIG(release, debug|release) {
    DESTDIR = ../lib/release
    LIBS += -L"../lib/release"
    MOC_DIR += ../GeneratedFiles/release
    OBJECTS_DIR += release
} else {    
    DESTDIR = ../lib/debug
    LIBS += -L"../lib/debug"
    MOC_DIR += ../GeneratedFiles/debug
    OBJECTS_DIR += debug
} 

include(sqxUiBase.pri)

The sqxUiBase.pri file contains the list of files that need to be built.

Now, the problem is that whatever I do, the resulting file is always named sqxUiBase.so.1.0.0, with a bunch of symlinks (sqxUiBase.so, sqxUiBase.so.1 and sqxUiBase.so.1.0) pointing to it. How can I make it so that there's only a sqxUiBase.so file and no links?

like image 447
Etienne de Martel Avatar asked Sep 20 '10 18:09

Etienne de Martel


People also ask

What does the number after .so mean?

Each file has a different number at the end of it. These numbers represent versions of the library. They're very important as it's these versions that determine the role of each file. They're two popular versioning schemes.

What is the difference between .so and so 1?

Yes, the ". 1" indicates the version number. This makes it possible to have multiple versions of the same library side-by-side, whereas the most common version has a link with no version number. If there is no need to distinguish between different versions, the version suffix might not be present.

What does .so file contain?

A file with the . SO file extension is a Shared Library file. They contain information that can be used by one or more programs to offload resources so that the application(s) calling the SO file doesn't have to actually provide the file.

What language is .so file?

The SO file stands for Shared Library. You compile all C++ code into the.SO file when you write it in C or C++. The SO file is a shared object library that may be dynamically loaded during Android runtime.


1 Answers

What you are looking for is making a plugin.

Add CONFIG += plugin to your project file, and qmake will generate a Makefile that builds a libFoo.so file, without the numbered links

like image 101
Fred Avatar answered Oct 20 '22 05:10

Fred