Adding libs (QT += ...) didn't work
-
wrote on 21 Jul 2014, 08:11 last edited by
Hello.
I have a problem with adding new libs to project.
I try add "xml" to QT += core, but that didn't work. Nothing changes.My workspace:
Qt 5.3 MinGW 32bit (auto-detected)
MinGW 4.8.2 32bit (auto-detected)How can i add new libraries?
I try various options, but it failed to.
Please help
Jareq000Screen:
-
wrote on 21 Jul 2014, 08:34 last edited by
hii
Add QT += xml
http://qt-project.org/doc/qt-5/qtxml-index.html -
wrote on 21 Jul 2014, 08:39 last edited by
Hi,
You should add the contents of your .pro file as well, since that is where the relevant items is located.
And instead of a screenshot, please just add the text in a code tag.
-
wrote on 21 Jul 2014, 10:29 last edited by
That's my .pro file:
@TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qtSOURCES += main.cpp
QT += core
QT += xmlINCLUDEPATH += C:/Qt/Qt5.3.1/5.3/mingw482_32/include
@and that didn't work.
I think, that QT can't find the libraries. I tried to add them, but it didn't work. Where can I check if everything is ok?
-
wrote on 21 Jul 2014, 10:54 last edited by
Did you run qmake after you modified the .pro file? If not, run qmake (you can find it in Build menu in Creator) and after that the linker should find the xml module libraries.
And also the include should work without the module name:
@
#include <QFile>
#include <QDomDocument>
//...
@ -
wrote on 21 Jul 2014, 10:58 last edited by
Yes, i run qmake.
If I include this line, Qt warns:
@ error: QFile: No such file or directory
#include <QFile>@ -
wrote on 21 Jul 2014, 11:01 last edited by
Why do you have
@CONFIG -= qt@
in your pro file?Remove that line and try again. -
wrote on 21 Jul 2014, 11:17 last edited by
It work's! :D
@CONFIG -= qt@
was added automatically, but why?
Thanks for replies.
-
wrote on 21 Jul 2014, 12:24 last edited by
Maybe you chose a "non qt" application when you created the project.
-
wrote on 22 Jul 2014, 05:46 last edited by
Yes, I choose.
Now I understand.
Thank You. -
wrote on 22 Jul 2014, 18:01 last edited by
hi that's really great ..
Please marked thread title as SOLVED so other members can seem it as solved.
9/11