2

HI,

I have the following: #include <libxml++/libxml++.h> and when i compile it says fatal error: libxml++/libxml++.h.No such file or directory. I've checked in the directory: /usr/include/libxml++-2.6/libxml++ and there it is the libxml++.h. Where am I wrong? why do i receive this error? thx

EDIT:

I did include g++ prg.cpp -o prg -I/usr/include/libxml++-2.6/ and now i have the

error:fatal error: glibmm/ustring.h: No such file or directory
just me
  • 157
  • 1
  • 8
  • 18

3 Answers3

2

You should use pkg-config to get the correct compiler options. See, for instance: http://developer.gnome.org/libxml++/stable/

murrayc
  • 2,103
  • 4
  • 17
  • 32
  • and...what should I do if I use cmake? Copy-paste the whole output of ´pkg-config´? – Lecko Dec 23 '15 at 19:52
  • I believe people use FindPkgConfig with CMake, though my past attempts have been fairly unconvincing: https://cmake.org/cmake/help/v3.4/module/FindPkgConfig.html . Here is a a recent question about that: http://stackoverflow.com/questions/29191855/what-is-the-proper-way-to-use-pkg-config-from-cmake – murrayc Dec 24 '15 at 14:03
0

Add the following option in the makefile:

g++ <some options> -I/usr/include/libxml++-2.6 <some other options>  

The -I flag in g++ adds the directory appearing after it to the include path. If you do not want to use that option, you need to replace the #include<libxml++-2.6/libxml++.h> with #include "absolute path to above header file". Note that using the -I flag also allows you to replace " " after the #include with < > tags.

Sriram
  • 10,298
  • 21
  • 83
  • 136
-1

add -I/usr/include/libxml++-2.6/libxml++ when compiling.

Jordonias
  • 5,778
  • 2
  • 21
  • 32
  • I did include what your link in my code (i didnt had to include libxml++) but now i have the error: fatal error: glibmm/ustring.h: No such file or directory – just me May 16 '11 at 07:01