Boost logo

Boost-Build :

Subject: Re: [Boost-build] fPIC option for boost
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-01-06 05:24:19

On Thursday, January 06, 2011 00:40:13 Ven Tadipatri wrote:
> Hi,
> I'm trying to build Boost version 1.44 for CentOS, and though my code
> compiles against it just fine, at link time it keeps complaining about
> an fPIC option:
> [ERROR] /usr/bin/ld: libboost-filesystem-1.44.a(v2_operations.o):
> relocation R_X86_64_32 against `a local symbol' can not be used when
> making a shared object; recompile with -fPIC
> [ERROR] libboost-filesystem-1.44.a: could not read symbols: Bad value
> [ERROR] collect2: ld returned 1 exit status
> Here is the command line I'm giving to bjam (v. 3.1.18)
> bjam address-model=64 cxxflags=-fPIC --user-config=user-config.jam stage
> variant=debug link=static threading=multi
> Here is the user-config.jam file
> using gcc : 4.1 : /usr/bin/gcc : <compileflags>-fPIC;
> It looks like I'm compiling with the right options, so what's going on?

For start, please touch v2_operations.cpp, run the above command with the
extra -d2 option and verify that -fPIC is present in compile command.

Then, run running 'ranlib' on libboost-filesystem-1.44.a


Vladimir Prus

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at