librdf compiling error, undefined reference to raptor_new_world_internal'

302 Views Asked by At

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.

1

There are 1 best solutions below

1
On BEST ANSWER

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.