问题 描述:

relocation R_X86_64_32S against `_ZTVN7leveldb6DBImplE' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib64/libleveldb.a: error adding symbols: Bad value

collect2: error: ld returned 1 exit status

问题分析:

在编译的时候没有添加-fPIC

解决方案:

在CMakeLists.txt中添加 set(CMAKE_POSITION_INDEPENDENT_CODE ON)

results matching ""

    No results matching ""