I am trying to build a shared library using Cmake. But I facing this error:
/usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
I tried to add -fPIC flag to cmake file in different ways as:
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
and:
add_compile_options(-fPIC)
But I still get same error again. Can anybody help me?