PDA

View Full Version : Cannot open include file: 'QXmlSimpleReader': No such file or directory



been_1990
11th June 2009, 23:47
When trying to include <QXmlSimpleReader> I get an error:

Error 1 fatal error C1083: Cannot open include file: 'QXmlSimpleReader': No such file or directory
Im using Visual Studio 2008.But even using QT Creator I get the same error. Why cant they find it? Thanks.

Update: Apparently any QXml include isn't being found.

h0nki
12th June 2009, 00:17
You have to add the XML library of QT to your Makefile or .pro file.

been_1990
12th June 2009, 01:25
And how do I do that?

Lykurg
12th June 2009, 07:09
And how do I do that?
Qt += xml

Look at the documentation under the QtSql Module!

spirit
12th June 2009, 07:09
add QT += xml in your pro-file and rebuild project.

been_1990
14th June 2009, 02:17
I get the same error after adding "QT += xml" to my .pro file.
Here is my .pro:


TARGET = IconView
TEMPLATE = app
SOURCES += main.cpp \
widget.cpp \

HEADERS += widget.h \

FORMS += widget.ui \

RESOURCES += res.qrc

Qt += xml

Lykurg
14th June 2009, 06:58
Have you truly/complete rebuilded your project? Try #include <QtSql> instead, same error? Have you build aour At installation with Xml support?

jpn
14th June 2009, 10:31
There are a few errors in your .pro file:





TARGET = IconView
TEMPLATE = app
SOURCES += main.cpp \
widget.cpp \ # <-- remove '\', the list of sources doesn't continue on the next line

HEADERS += widget.h \ # <-- remove '\', the list of headers doesn't continue on the next line

FORMS += widget.ui \ # <-- remove '\', the list of forms doesn't continue on the next line

RESOURCES += res.qrc

Qt += xml # <-- it should be "QT", not "Qt"

been_1990
14th June 2009, 12:33
Ok, compiling in QtCreator , both #include <QXmlSimpleReader> and #include <QtSql> work. But now what about #include <QtXmlPatterns>? It doesnt work. Gives me the same error.
.pro:

TARGET = IconView
TEMPLATE = app
SOURCES += main.cpp \
widget.cpp

HEADERS += widget.h

FORMS += widget.ui

RESOURCES += res.qrc

QT += xml
QT += sql

Lykurg
14th June 2009, 12:55
Ok, compiling in QtCreator , both #include <QXmlSimpleReader> and #include <QtSql> work. But now what about #include <QtXmlPatterns>?

Come on, read the documentation! It's the same like the xml-module. Doc under QtXmlPatterns->Running the query engine from your Qt application!

been_1990
15th June 2009, 19:44
Ok, thanks for the help! Problem solved!