[redland-dev] Help with RDF-Redland example2.c

Dave Beckett dave at dajobe.org
Mon Oct 31 00:14:58 GMT 2005


jche5167 at mail.usyd.edu.au wrote:
> Hi,
> 
> I'm a real newbie to C, so when I was tring to run the RDF redland examples
> I ran into some compile errors, maybe someone could help.
> 
> Firstly I assume the examples provided in the RDF Redland framework are
> working and do not have compile errors, is this correct to say.
> 
> I believe I have successfully installed RDF Redland. ./confiure, make, make
> check and make install all return no errors. But when I try to compile the
> example2.c with gcc -o example2 example2.c I get errors along the line of
> -> undefined  reference to '_librdf_new_world'
> undefined reference to '_librdf_new_uri'
> undefined reference to '_lifrdf_new_model'
> 
> Does anyone have any idea why I might be getting these errors?

Do you mean you *just* did 'gcc -o example2 example2.c' ?  That wouldn't 
work as you don't provide the redland library and it's dependent 
libraries.  There is a make target for each example so you can use:
   make example2
however it's easiest to just build them all with:
   make examples

or if you want to do it all by hand you can use:
   gcc -o example2 example2.c `redland-config --cflags` `redland-config 
--libs`

Otherwise can you paste the full link line and the complete list of 
link/compile errors.  Is -lrdf in the link line?  Are you installing 
redland into a library directory that's found by the linker?  (see man 
ld.so on linux if it's linux).  What system are you running it on?

Dave


More information about the redland-dev mailing list