« Emulating <Windows Key>+L to Lock Your Workstation | Main | o2.c »

February 24, 2006

Shared-libary build fails on AMD_64

While trying to link against a shared library I received the following error: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC.

The solution is quite simple, in the Makefile of the offending library, simply add -fPic to the end of the CFLAGS line. Finally, rebuild and reinstall the library (make clean && make && make install).

I am sure there are cleaner ways (like passing the extra CFLAGS to configure), but it works for one off jobs.

Posted by spiffed at February 24, 2006 10:56 PM

Comments

Post a comment




Remember Me?