[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

R_X86_64_32S error building a shared library

From: Adam Nielsen
Subject: R_X86_64_32S error building a shared library
Date: Wed, 21 Jan 2009 21:32:57 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv: Gecko/20081215 Thunderbird/ Mnenhy/

Hi all,

I've decided to bite the bullet and finally learn how to use autoconf, and so far I seem to be doing okay except for the final step in the build process. I'm trying to create a shared library, and some code in the library uses Boost. Since users of my library do not have to use Boost in their code, I want my shared library to be linked to the Boost libraries, so that users of my library don't need to link to the Boost libraries themselves.

Unfortunately I can't seem to get this to work - I keep getting this error:

x86_64-pc-linux-gnu/bin/ld: .../lib64/libboost_system-mt-1_37.a(error_code.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
.../lib64/libboost_system-mt-1_37.a: could not read symbols: Bad value

I even tried re-running the commands by hand, adding in -fPIC but I still get the error. Does anyone know what this error means, or how I'm supposed to link other shared libraries in with my own shared library?

This is my at the moment:

libtest_la_SOURCES = main.cpp $(top_srcdir)/include/gamearchive.hpp

The $(BOOST_*) variables are set by the "boost.m4" file from the Boost website. This does work fine if I use $(BOOST_*) in my executable, but it doesn't work with the shared library.

Any pointers would be much appreciated!

Many thanks,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]