Welcome! Log In Create A New Profile

Advanced

QXML* and QSax not found (A2Q3)

Posted by Seymore 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
QXML* and QSax not found (A2Q3)
July 06, 2010 09:04AM
Hi All

Did anyone come accross this issue with the XML libraries fot their Qt installation?

Language: C++ (QT)
In file included from main.cpp:1: myhandler.h:4:30: QXmlDefaultHandler: No such file or directory In file included from main.cpp:1: myhandler.h:6: error: expected class-name before ';{'; token myhandler.h:12: error: expected `,'; or `...'; before ';&'; token myhandler.h:12: error: ISO C++ forbids declaration of `QXmlAttributes'; with no t ype myhandler.h:18: error: field `indent'; has incomplete type main.cpp:3:27: QXmlInputSource: No such file or directory main.cpp:4:28: QXmlSimpleReader: No such file or directory main.cpp: In function `int main(int, char**)';: main.cpp:14: error: `QXmlInputSource'; undeclared (first use this function)

I checked in QT's \lib folder and found QXml.h which was just a pointer to ../src/QXml.h which contained a lot of stubs including QXmlDefaultHandler. The QXml.cpp is also there.

Still I cannot compile even the examples in the text book. What am I doing wrong?
avatar Re: QXML* and QSax not found (A2Q3)
July 06, 2010 05:45PM
Did you include the XML libraries in your .pro file? QT += xml
avatar Re: QXML* and QSax not found (A2Q3)
July 07, 2010 05:42PM
@CountZero

Good point, but that will only help if there are linker errors (ie "undefined reference ..."winking smiley

@Seymore

Could you please post the first 10 lines of myhandler.h please?
Re: QXML* and QSax not found (A2Q3)
July 08, 2010 01:04PM
hi robanaurochs

this is the myhandler.h as from the CD

Language: C++ (QT)
#ifndef MYHANDLER_H #define MYHANDLER_H //start #include <QXmlDefaultHandler> class QString; class MyHandler : public QXmlDefaultHandler { public: bool startDocument(); bool startElement( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts); bool characters(const QString& text); bool endElement( const QString & namespaceURI, const QString & localName, const QString & qName ); private: QString indent; }; //end   #endif // #ifndef MYHANDLER_H

and Oh, CountZero, I did not define anything special in my .pro file.
I will try it and see if anything changes.
(shouldn't qmake -project detect I'm using QXml* stuff?)
<I know I'm lazy ... smile
>
avatar Re: QXML* and QSax not found (A2Q3)
July 08, 2010 04:33PM
And did you try it?
Re: QXML* and QSax not found (A2Q3)
July 12, 2010 12:06PM
CountZero = Hero

QT += xml did the trick, it compiled! thanks
(I don't know where I missed that?)
avatar Re: QXML* and QSax not found (A2Q3)
July 13, 2010 10:46PM
Thanks and it's a pleasure!
Sorry, only registered users may post in this forum.

Click here to login