snappy是一款基于C++语言开发的压缩算法,旨在提供较高的压缩解压速率和相对合理的压缩比。
github上的仓库地址 https://github.com/google/snappy
背景
linux下开发一个动态库,编译了snappy的静态库,显示需要 recompile with -fPIC。下载的源码未开启pic。
:-1: error: /home/include/..//lib/libsnappy.a(snappy.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
:-1: error: /home/include/..//lib/libsnappy.a(snappy-sinksource.cc.o): relocation R_X86_64_32 against symbol `_ZTVN6snappy6SourceE' can not be used when making a shared object; recompile with -fPIC
:-1: error: final link failed: nonrepresentable section on output
:-1: error: co