Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot compile when using libxml

Tags:

c

libxml2

I have a source file that I can run via the terminal using

gcc source.c -I/usr/include/libxml2 -lxml2 -o output

but when I #include the source file which includes the libxml source files, the compiler complains that the libxml/xmlmemory.h: , libxml/parser.h:, libxml/xpath.h cannot be found : no such file or directory.

like image 947
some_id Avatar asked Apr 04 '11 20:04

some_id


1 Answers

You need always to keep the -I/usr/include/libxml2 in your gcc statement, so that it can find the header files.

like image 167
Benoit Thiery Avatar answered Oct 23 '22 21:10

Benoit Thiery