如何避免在.so文件名中包含版本号 [英] How to avoid having version numbers in .so file name

查看:1015
本文介绍了如何避免在.so文件名中包含版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用qmake在Linux上构建动态库.这是我的.pro文件:

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)

sqxUiBase.pri文件包含需要构建的文件列表.

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

现在,问题是无论执行什么操作,生成的文件始终都命名为sqxUiBase.so.1.0.0,并带有一堆指向其的符号链接(sqxUiBase.sosqxUiBase.so.1sqxUiBase.so.1.0).如何做到只有一个sqxUiBase.so文件而没有链接?

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?

推荐答案

您正在寻找的是制作plugin.

CONFIG += plugin添加到您的项目文件中,然后qmake将生成一个Makefile,该文件将生成一个libFoo.so文件,而没有编号的链接

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

这篇关于如何避免在.so文件名中包含版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆