Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple XML I/O i cant figure out....going nuts here.

Status
Not open for further replies.

Iceman2005

Programmer
May 6, 2005
22
US
okay i wrote a simple XML program.... everything COMPILES and its fine. when i ran it... it CRASHES....

#include <stdlib.h>
#include <string.h>

#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>

int main(int argc, char **argv)
{
xmlDocPtr doc = NULL;

/* load doc file */
doc = xmlParseFile(argv[1]);

if (doc)
{
/* print xml document to stdout */
xmlDocDump(stdout, doc); // CRASHES HERE
}
return(0);
}


// the xml file as input....
<xml>hello</xml>


// the command to run it...
C:\progname xmlfile.xml



why in the world did it crash on xmlDocDump, i remember my program needs to add libxml2.dll and i compiled also with libxml2.lib

thanks.
755
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top