14

I want to use libxml2 in my eclipse project. I can use this library on command line by "

g++ main.cpp -I/usr/include/libxml2 -lxml2 -o output "

But I can't use on eclipse.I add C++ Build->Setting->GCC C Compiler->Includes

-I/usr/include/libxml2 and I add C++ Build->Setting->GCC C++ Linker->library -lxml2

But When I build my project, I get an error via

libxml/parser.h:15:31: fatal error: libxml/xmlversion.h: No such file or directory

andressophia
  • 527
  • 2
  • 6
  • 9
  • The problem is solved! I add /usr/include/libxml2 to C++ Compiler-> Includes and xml2(not -lxml2) to GCC C++ Linker->library – andressophia Apr 23 '14 at 21:20

1 Answers1

45

This is because libs are not complete. You should install them.

Here's one thread that might be helpful.

One solution:

sudo apt-get install libxml2-dev libxslt1-dev

For Redhat/Centos/Fedora:

yum install libxml-devel
Community
  • 1
  • 1
Charles Xu
  • 558
  • 5
  • 9