troubleshooting Question

Urgent:Compiling on Linux while using LibXML

Avatar of mte01
mte01Flag for Lebanon asked on
C
3 Comments1 Solution289 ViewsLast Modified:
Hey experts,

  After successfully installing the libxml2-2.6.19 library on Linux Red Hat 8 (as the instructions in their associated README file), I  tried to compile a file called XML_Parser.c which was using this library using the following:

gcc XML_Parser.c -o XML_Parser -libxml -libxml2 -Wno-deprecated

and I have the following includes and declarations in my program:

#include <tree.h>
#include <parser.h>
#include <xpath.h>
#include <xpathInternals.h>



xmlXPathContextPtr xpathCtx;
xmlDocPtr doc;

and I got the following error upon compilation (as if the library was not installed - although I made sure that it was):

XML_Parser.c:5:18: tree.h: No such file or directory
XML_Parser.c:6:20: parser.h: No such file or directory
XML_Parser.c:7:19: xpath.h: No such file or directory
XML_Parser.c:8:28: xpathInternals.h: No such file or directory
XML_Parser.c:15: parse error before "xpathCtx"
XML_Parser.c:15: warning: data definition has no type or storage class
XML_Parser.c:16: parse error before "doc"
XML_Parser.c:16: warning: data definition has no type or storage class

any help on successfully compiling my program??
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros