1

After I installed raptor (librdf.org) successfully, I run g++ test.cpp to compile. But get raptor2.h: No such file or directory.

So I copy /usr/include/raptor2/raptor2.h to /usr/include/raptor2.h, and the error above dismiss. But a new error occur:undefined reference to `raptor_new_world_internal'.

Can somebody tell me what's in mistake, thank you.. Environment: ubuntu 12.04.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
finch
  • 107
  • 8

1 Answers1

1

Instead of copying your header file, try

#include <raptor2/raptor2.h>

And compile with g++ test.cpp -lraptor2. You need to link against the library in order to be able to use it.

nicebyte
  • 1,498
  • 11
  • 21
  • Author of raptor / librdf here. You should be using `-I/usr/include/raptor2/` to compile with `-lraptor2` to link and `#include ` in the code. Relative includes might not work correctly without that. – dajobe Jan 21 '15 at 15:12