Jump to content
  • Advertisement
Sign in to follow this  
john_hopkins

Expat Weirdness - Solved

This topic is 4721 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, recently, I started using XML for my projects (after being forced to use it for a collegue project that involved tomcat and cocoon), and I must said Im very pleased with it. I used xerces-J for a Java application a couple of days ago, and It was awesome, I mean, In ended up learning the basics like in a couple of hours, and by then I had my parser up and running. Now, for a c++ project, I was thinking of using expat, since I like it (maybe its the fact Ive seen it being used in a couple of videogames, Hitman and some other I dont remember), but Im having a hard time with it. And sincerely, xerces-C seems too big, and Im kinda in a rush. The problem is, I compiled the examples "elements.c" and "outline.c" and everything went fine, until I had to run them, and I got some weird results. In both, the xml document is parsed, but in the output (that is supossed to show a on-the-fly element indentation showing the names of the elements in the XML document), I dont see the full names for the elements, only the inicials, so for example, for a simple xml file like this
...
<catalog>
<book>
<title>a title</title>
<author>and author</author>
</book>
</catalog>
I get the following output
C
 B
  T
  A
When it is supossed to show something among the lines of
Catalog
  Book
    Title
    Author
What is more, I tried to register an character handler with the parser, so, additional to the examples, Id get the contents in the elements (a title, an author,...) but I get the same problem (only the initials show up) Anyone knows why this could be happening? Im using dev-cpp latest version, as well as expat's one, and tried with the original expat distribution with VC *.libs and the "official" devpack. Both give the same results [Edited by - john_hopkins on June 20, 2005 2:11:56 AM]

Share this post


Link to post
Share on other sites
Advertisement
Well, Ive been working with expat for some time now, and didnt notice any problems (Im using dev-cpp too).

Why dont you try this, in project options->parameters->Linker, delete what you have (aka, clear that text area), and put the following

-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32

For the "average" inclusion of libs, and then manually add the libexpat.lib with the button "Add library or Object".

Thats it, try to compile the examples, and everything should be fine now, I think probably your problem relates to the non-inclusion of the "average" libraries above (that, in case you dont include them). I got them from importing the "outline.dsp" and "elements.dsp" and converting into a dev-cpp native project file.

Hope that helps, cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!