gcc `xml2-config --cflags --libs` -o librairie_xml /librairie_xml.c
In file included from ../librairie_xml.c:24:
../librairie_xml.h:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNewDoc'
../librairie_xml.h:51: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.h:54: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.h:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.h:62: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.h:65: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
../librairie_xml.h:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
../librairie_xml.c:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNewDoc'
../librairie_xml.c:70: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.c:94: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.c:119: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.c:145: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.c:170: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xmlNodePtr'
../librairie_xml.c:197: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
../librairie_xml.c:222: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
I tried to put all the include of the .h file into the .c file, it just removes the errors coming from the .h file.
I also tried #include <libxml/tree.h> as well as #include "libxml/tree.h", it made no difference.
The most disturbing is all of this, it's that I can still compile the file in which I did my first tests with libxml, (which is in the same folder than librairie_xml.c), named test_short.c, using the same command line : gcc `xml2-config --cflags --libs` -o test test2.c
And it works ! I can compile and execute it without any problem. I tried to compare them, but the only major difference is that test_short.c has a main. But it has nothing to do with my errors.
I joined 3 files to this mail, test_short.c, librairie_xml.c and librairie_xml.h, if anyone can find out what's wrong.
Thanks a lot