“Recompile with -fPIC” error persists even after adding -fPIC compile flag

前端 未结 1 757
长发绾君心
长发绾君心 2021-01-20 20:27

I have downloaded some C++ which I want to compile from source. After running cmake ../src and then make from the command line, whilst in the build

相关标签:
1条回答
  • 2021-01-20 21:09

    I believe Mark is correct when he says the error is about libBulletCollision.a. You are building a .so built with -fPIC but linking against a .a that did not use -fPIC. You will either need to change and build a static library or rebuild and install a new dependent libBulletCollision.a using -fPIC.

    By the way, you should add the -fPIC flag to your build in a more permanent way in the cmake configure step rather in this transient way overriding CXXFLAGS when running make.

    Also using make VERBOSE=1 with cmake generated makefile builds is quite helpful when debugging builds.

    0 讨论(0)
提交回复
热议问题