[英]Qt build both release and debug libraries
I needed to install Qt SDK to Redhat backend machine which does not have a GUIs. 我需要将Qt SDK安装到没有GUI的Redhat后端机器上。 (Amazon ec2).
(亚马逊ec2)。 When I tried to install it failed due to fail to connect display.
当我尝试安装时由于无法连接显示而失败。
Then I tried to download the source and compile. 然后我尝试下载源代码并进行编译。 If I use configure -debug, it only compile debug libraries.
如果我使用configure -debug,它只编译调试库。 Same as it compiles and install release binaries only if I specify -release.
与它仅在我指定-release时编译和安装发布二进制文件相同。 Also in my *.pro file it links the last installed build without considering CONFIG += debug or CONFIG += release
同样在我的* .pro文件中,它链接最后安装的构建,而不考虑CONFIG + = debug或CONFIG + = release
I need both formats. 我需要两种格式。 libQt5Core.so and libQt5Core.d.so.
libQt5Core.so和libQt5Core.d.so。 And need to link separate libs according to the CONFIG.
并且需要根据CONFIG链接单独的库。
I resolved the issue doing this. 我解决了这个问题。
configure -debug -qtlibinfix .d
and installed. configure -debug -qtlibinfix .d
并进行了安装。 configure -release
and installed again. configure -release
并再次安装。 Now I have two binaries *.d.so
for debug and *.so
for release in /usr/local/Qt-5.6.0
. 现在我有两个二进制文件
*.d.so
用于调试, *.so
用于在/usr/local/Qt-5.6.0
发布。
Then edited /usr/local/Qt-5.6.0/mkspecs/features/qt.prf
and replaced 然后编辑
/usr/local/Qt-5.6.0/mkspecs/features/qt.prf
并更换
MODULE_MODULE = $$eval(QT.$${QTLIB}.module)
with 同
MODULE_MODULE =
debug: MODULE_MODULE = $$eval(QT.$${QTLIB}.module).d
else: MODULE_MODULE = $$eval(QT.$${QTLIB}.module)
If I used CONFIG += debug
in *.pro file, it links with *.d.so
. 如果我在* .pro文件中使用
CONFIG += debug
,它会链接*.d.so
。 Otherwise it links with *.so
. 否则它与
*.so
链接。
If you want both sets of libraries you can use the configure -debug-and-release
option. 如果您需要两组库,则可以使用
configure -debug-and-release
选项。 Take a look at the Configuration Options for Qt for more options. 有关更多选项,请查看Qt的配置选项 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.