473,545 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C function use to read & write an XML file

10 New Member
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 "xmlValidCt xt"
/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 "xmlCharEncodin g"
/usr/include/libxml2/libxml/parser.h:825: error: parse error before "xmlInputReadCa llback"
/usr/include/libxml2/libxml/parser.h:832: error: parse error before "xmlCharEncodin g"
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
3 3538
sicarie
4,677 Recognized Expert Moderator Specialist
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 "xmlCharEncodin g"
/usr/include/libxml2/libxml/parser.h:825: error: parse error before "xmlInputReadCa llback"
/usr/include/libxml2/libxml/parser.h:832: error: parse error before "xmlCharEncodin g"
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 "xmlValidCt xt"
/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
4,677 Recognized Expert Moderator Specialist
jinendrashankar-

Please check your Private Messages, accessible through the PMs link on the top right corner of the page.
Nov 14 '07 #3
jinendrashankar
10 New Member
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

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

Similar topics

9
4939
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or...
5
2017
by: Arvind P Rangan | last post by:
Hi, i like to read an existing xml file which has a schema defined to it, and then write or add data to the existing xml file using vb.net/c#. May be this Question has been answered earlier. Pls if anyone knows the link or example let me know Thanks ARvind.
4
13212
by: thinktwice | last post by:
i have just made a test project :(win32 console) //file : func.h #ifndef _FUNC_H_ #define _FUNC_H_ void func1() { return; };
6
2235
by: cj | last post by:
I'm receiving an xml formatted string that I pull data from by reading it into an xml document like this: Dim doc As New Xml.XmlDocument doc.LoadXml(respstr) Dim co_name As Xml.XmlNodeList = doc.GetElementsByTagName("co_name") textbox1.text = co_name(0).innertext Now I'm getting company names that have ampersands in them. I was not...
4
147663
by: _Mario.lat | last post by:
Hallo, I have a little question: In the function session_set_save_handler I can pass the name of function which deal with session. In Xoops code I see the use of this function like that: session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'),...
0
1887
by: magicbeans | last post by:
I am trying to create a .bin file of records from a .txt file. Initially the records are stored in a text file and I want to Read from the .txt file and Write to the .bin file. This is the C++ code. The result write exactly but it has funny-looking unwanted characters attached at the end of the .bin file. How do I fix it? #include...
14
1938
by: Bryan Parkoff | last post by:
Do you know that current C++ Compiler limits to 64KB segments in source code? It is good news that Microsoft Visual C++ 2005 has expanded to 4GB segments in source code. 4GB segment is ideal for large object using pointer to function and switch. Please list other C++ Compilers if they have added a support of 4GB segments. I am able to...
2
7691
by: Bina | last post by:
hi, I want to read & write a html file which contain the japanese character. Now how i will do it?I can read & write english character . but when i read & write Japanese character from the html file then the writed html file cannnot show the japanese character. my new created html file show the another character, it cannot show the original...
0
7496
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7784
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6014
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.