c++ - How to compile static library with -fPIC from boost.python -


by default, libboostpython.a compiled without -fpic. have make python extension , dynamic library -fpic links static libraries. how can compile static library (libboostpython.a) -fpic boost.python?

there couple options use:

  • compile boost source , pass compiler options bjam. e.g. bjam ... cxxflags='-fpic'. compile every boost source file position independent code.
  • use boost in form of shared libraries. in case want ship boost shared libraries along application make sure appropriate version of boost used. can link executable '-wl,-rpath,$origin' flag, when dynamic linker searches shared libraries required executable looks them in directory executable is. see man ld.so more details on $origin.

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -