PDA

View Full Version : Qxt with Qt5.0 MingW: qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead



ujwala
4th February 2014, 12:54
Hi,

I am currently using QT 4.8 and MingW compiler for my application. I am using third party libraries (Qxt & QWT). Now I want to port our application to Qt5. Qxt library is successfully build.

Steps followed for building Qxt:



qmake
mingw32-make
mingw32-make install


qxt.prf and qxtvars.prf file are copied to C:\Qt\Qt5.0.2\5.0.2\mingw47_32\mkspecs\features

In application's .pro file I have mentioned



CONFIG += qxt
QXT += core gui


When I compiled it I am getting the errors



Project WARNING: qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead.
Project ERROR: No module matching library 'QxtGui' found.



Could you please guide me resolving this issue?

Thanks in advance.

ChrisW67
4th February 2014, 21:23
QT += qxt
QXT += core gui
I expect the CONFIG line is not required.

ujwala
5th February 2014, 05:32
Thanks Chris.

I tried your solution but getting following error:



QT += qxt
QXT += core gui




Project ERROR: Unknown module(s) in QT: qxt

ChrisW67
5th February 2014, 06:24
Then qxt.prf is not in the folder that the version of qmake you are using is looking. It should have been put in the correct place (for the version of Qt that owned the qmake you used) automatically when you ran "mingw32-make install" during the Qxt build.

Edit: Execute:


qmake -query

and look for the QMAKE_MKSPECS entry. The "features" folder should be immediately under that folder and contain qxt.prf.

ujwala
7th February 2014, 11:56
Hi Chris,

I tried qmake -query command I got following output where QMAKE_MKSPECS entry was not present



QT_SYSROOT:
QT_INSTALL_PREFIX:D:\Qt\Qt5.0.2\5.0.2\mingw47_32
QT_INSTALL_ARCHDATA:D:\Qt\Qt5.0.2\5.0.2\mingw47_32
QT_INSTALL_DATA:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\
QT_INSTALL_DOCS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\doc
QT_INSTALL_HEADERS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\ include
QT_INSTALL_LIBS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\lib
QT_INSTALL_LIBEXECS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32 \libexec
QT_INSTALL_BINS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin
QT_INSTALL_TESTS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\te sts
QT_INSTALL_PLUGINS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\ plugins
QT_INSTALL_IMPORTS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\ imports
QT_INSTALL_QML:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\qml
QT_INSTALL_TRANSLATIONS:D:\Qt\Qt5.0.2\5.0.2\mingw4 7_32\translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:D:\Qt\Qt5.0.2\5.0.2\mingw47_32 \examples
QT_INSTALL_DEMOS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\ex amples
QT_HOST_PREFIX:D:\Qt\Qt5.0.2\5.0.2\mingw47_32
QT_HOST_DATA:D:\Qt\Qt5.0.2\5.0.2\mingw47_32
QT_HOST_BINS:D:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin
QMAKE_SPEC:win32-g++
QMAKE_XSPEC:win32-g++
QMAKE_VERSION:3.0
QT_VERSION:5.0.2


Then I manually added it


QMAKE_MKSPECS:C:\Qt\Qt5.0.2\5.0.2\mingw47_32\mkspe cs


After compilation I got following error:

Project ERROR: Unknown module(s) in QT: qxt

-Ujwala