By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,370 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

C function use to read & write an XML file

P: 10
i am getting following error in my code
help me to slove this issue
$ gcc -Wall -g -I/usr/include/libxml2/libxml -c create_xml.c
In file included from create_xml.c:2:
/usr/include/libxml2/libxml/tree.h:20:31: libxml/xmlversion.h: No such file or directory
/usr/include/libxml2/libxml/tree.h:880:30: libxml/xmlmemory.h: No such file or directory
In file included from create_xml.c:3:
/usr/include/libxml2/libxml/parser.h:12:25: libxml/tree.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:13:26: libxml/valid.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:14:29: libxml/entities.h: No such file or directory
In file included from create_xml.c:3:
/usr/include/libxml2/libxml/parser.h:182: error: parse error before "xmlValidCtxt"
/usr/include/libxml2/libxml/parser.h:182: warning: no semicolon at end of struct or union
/usr/include/libxml2/libxml/parser.h:222: error: parse error before '}' token
/usr/include/libxml2/libxml/parser.h:647:29: libxml/encoding.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:648:26: libxml/xmlIO.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:649:28: libxml/globals.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:763: error: parse error before "xmlCharEncoding"
/usr/include/libxml2/libxml/parser.h:825: error: parse error before "xmlInputReadCallback"
/usr/include/libxml2/libxml/parser.h:832: error: parse error before "xmlCharEncoding"
create_xml.c: In function `main':
create_xml.c:11: error: structure has no member named `root'
create_xml.c:12: error: structure has no member named `root'
create_xml.c:13: error: structure has no member named `root'
create_xml.c:14: error: structure has no member named `root'
create_xml.c:16: error: structure has no member named `root'
Nov 13 '07 #1
Share this Question
Share on Google+
3 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
i am getting following error in my code
help me to slove this issue
$ gcc -Wall -g -I/usr/include/libxml2/libxml -c create_xml.c
In file included from create_xml.c:2:
/usr/include/libxml2/libxml/tree.h:20:31: libxml/xmlversion.h: No such file or directory
/usr/include/libxml2/libxml/tree.h:880:30: libxml/xmlmemory.h: No such file or directory
In file included from create_xml.c:3:
/usr/include/libxml2/libxml/parser.h:12:25: libxml/tree.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:13:26: libxml/valid.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:14:29: libxml/entities.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:647:29: libxml/encoding.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:648:26: libxml/xmlIO.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:649:28: libxml/globals.h: No such file or directory
/usr/include/libxml2/libxml/parser.h:763: error: parse error before "xmlCharEncoding"
/usr/include/libxml2/libxml/parser.h:825: error: parse error before "xmlInputReadCallback"
/usr/include/libxml2/libxml/parser.h:832: error: parse error before "xmlCharEncoding"
Looks like it can't find several of the files you attempted to include in your program on your machine.
In file included from create_xml.c:3:
/usr/include/libxml2/libxml/parser.h:182: error: parse error before "xmlValidCtxt"
/usr/include/libxml2/libxml/parser.h:182: warning: no semicolon at end of struct or union
I think the second message is really self-explanatory.
create_xml.c: In function `main':
create_xml.c:11: error: structure has no member named `root'
create_xml.c:12: error: structure has no member named `root'
create_xml.c:13: error: structure has no member named `root'
create_xml.c:14: error: structure has no member named `root'
create_xml.c:16: error: structure has no member named `root'
I'm betting this 'root' object is trying to use some of the libraries above, but it might just be improperly instantiated. Some code would have been helpful there.
Nov 13 '07 #2

sicarie
Expert Mod 2.5K+
P: 4,677
jinendrashankar-

Please check your Private Messages, accessible through the PMs link on the top right corner of the page.
Nov 14 '07 #3

P: 10
Hi All,

Check this code its use to read XML data from XML file. try this code in your local system with command

cc create_xml.c -o create_xml -I/usr/include/libxml2 -L/usr/lib -R/usr/lib -lxml2 -lz -lpthread -lm -lsocket -lnsl

its create your EXE create_xml in local then run
./create_xml <file.xml>
Nov 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.