I would like to build library (say "mylib", static or shared, doesn't really matter) that internally uses boost (boost::asio in particular). Library public interface doesn't depend on any boost types.
Library supposed be used by Qt application, and I don't want to introduce any boost dependencies into app's build scripts (it uses qmake currently) and I need the "mylib" to be only dependency. Library build system is CMake. I tried to build shared library with statically linked boost but I'm getting errors like:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libboost_system.a: error adding symbols: Bad value
Primary target target/toolchain is gcc x64 (Linux) but it would be good to have crossplatform solution (at least mingw64 and MacOS X).
Creating static library is an option too, but I couldn't figure out how to include static boost libs into "mylib"