Re: R_X86_64_32S error building a shared library - solved

2009-01-31 Thread Adam Nielsen
It does prove something about Boost to me - as soon as I add the Boost libraries to the above program I get the error, which implies that something isn't compiled with -fPIC. Since Boost was the only thing added, Boost must have been compiled without -fPIC. As previously mentioned, that's just

Re: R_X86_64_32S error building a shared library

2009-01-26 Thread Adam Nielsen
$ g++ -fPIC -c -o main.o main.cpp -I/usr/include/boost-1_37/ && g++ -o test.so main.o -shared This works since main.cpp is being compiled to main.o with PIC. However, Boost is not involved here so it proves nothing about Boost. It does prove something about Boost to me - as soon as I add the

Re: R_X86_64_32S error building a shared library

2009-01-25 Thread Adam Nielsen
I have Boost installed on my system as a shared library, so I don't understand why libtool/gcc won't link to it. Hmm okay, I think I've just discovered why - it seems my local installation of Boost was compiled without the -fPIC flag, as I have problems even with trivial compiles, without usin

Re: R_X86_64_32S error building a shared library

2009-01-25 Thread Adam Nielsen
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 You do not need to have boost a

Re: R_X86_64_32S error building a shared library

2009-01-25 Thread Adam Nielsen
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 You do not need to have boost

Re: R_X86_64_32S error building a shared library

2009-01-24 Thread Adam Nielsen
Hi Ralf, Thanks for your reply, and sorry about taking so long to follow up! 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_s

R_X86_64_32S error building a shared library

2009-01-21 Thread Adam Nielsen
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