Supun Induwara
Supun Induwara

Reputation: 1662

Qt build both release and debug libraries

I needed to install Qt SDK to Redhat backend machine which does not have a GUIs. (Amazon 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. Same as it compiles and install release binaries only if I specify -release. Also in my *.pro file it links the last installed build without considering CONFIG += debug or CONFIG += release

I need both formats. libQt5Core.so and libQt5Core.d.so. And need to link separate libs according to the CONFIG.

Upvotes: 5

Views: 6367

Answers (2)

Supun Induwara
Supun Induwara

Reputation: 1662

I resolved the issue doing this.

  • First I configured configure -debug -qtlibinfix .d and installed.
  • Then I configured configure -release and installed again.

Now I have two binaries *.d.so for debug and *.so for release in /usr/local/Qt-5.6.0.

Then edited /usr/local/Qt-5.6.0/mkspecs/features/qt.prf and replaced

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. Otherwise it links with *.so.

Upvotes: 4

A. Sarid
A. Sarid

Reputation: 3996

If you want both sets of libraries you can use the configure -debug-and-release option. Take a look at the Configuration Options for Qt for more options.

Upvotes: 1

Related Questions