Monday 9 December 2013

Build MongoDB C++ driver with -fPIC

-fPIC is useful option when building c++ app using g++ compiler.
This page explains it: http://explainshell.com/explain?cmd=g%2B%2B+-fpic
In short, when compiling so lib, always using it will be a better idea.

For enabling this option when building MongoDB c++ 2.4.X driver, edit SConstruct file in line 81
    env.Append(CCFLAGS=["-O3", "-pthread", "-fPIC"])

Then run scons install to build it. 

No comments:

Followers

Contributors