How to avoid having version numbers in .so file name

梦想的初衷 提交于 2019-12-21 07:10:09

问题


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?


回答1:


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




回答2:


After looking at the qmake source I found CONFIG += unversioned_libname for nix and CONFIG += skip_target_version_ext for windows.



来源:https://stackoverflow.com/questions/3754434/how-to-avoid-having-version-numbers-in-so-file-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!