I am trying to compile a shared library in Linux using a Makefile created with Cmake, but running make I obtain the following error: I provide the following command in the CMakeLists.txt in order to say that I want a shared (.so) library: add_library(cpp-lib SHARED ${CPP_FILES}) What else do I need to specify in order to avoid the -fPIC error