gussmith23 / capstats

stats for caps
GNU Affero General Public License v3.0
0 stars 1 forks source link

Error when attempting to compile debug version #12

Open gussmith23 opened 6 years ago

gussmith23 commented 6 years ago

if I do cmake .. -DCMAKE_BUILD_TYPE=Debug and then build, I get the error:

/usr/bin/ld: /usr/local/lib/libJsonBox_d.a(Value.cpp.o): relocation R_X86_64_32 against.bss' can not be used when making a shared object; recompile with -fPIC`

gussmith23 commented 6 years ago

This might be fixable by making capstats build JsonBox, and adding the CMAKE_POSITION_INDEPENDENT_CODE property on the JsonBox target as described here: https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option

For now I've fixed it by building and installing JsonBox using the PIC setting.