-fPIC 编译标志有什么作用? [英] What does the -fPIC compilation flag does?
问题描述
-fpic 标志有什么作用?我想安装一个库(OpenSFM),据说它需要构建和安装 Ceres Solver使用 -fPIC 编译标志.
What the -fpic flag does? I want to install a library (OpenSFM) and it is stated that it will need the Ceres Solver built and installed with the -fPIC compilation flag.
问题是我已经安装了没有 -fPIC 标志的 Ceres Solver 并且其他库已经依赖它.我该如何解决这个问题?
The problem is I already installed the Ceres Solver without the -fPIC flag and other library already depended on it. How can I solve this?
推荐答案
可以找到关于 -fPIC 的一个很好的解释 这里.
A good explaination for -fPIC can be found here.
我认为这里的主要问题是您是否仍然可以在不重建 Ceres Solver 的情况下继续安装 OpenSfM.据我所知,你不能.
I think the main question here is whether if you can still go ahead and install OpenSfM without rebuilding Ceres Solver. As far as I know, you can't.
您可以做的最直接的事情是重建 Ceres Solver 并重新安装 PIC 版本.
The most straightforward thing you can do is rebuild Ceres Solver and reinstall the PIC version.
cmake .. -DCMAKE_C_FLAGS=fPIC \
-DCMAKE_CXX_FLAGS=-fPIC \
-DSOMEOTHERARGUMENTSTHATYOUMIGHTHAVE
让我们知道它是如何为您服务的.:)
Let us know how it worked out for you. :)
这篇关于-fPIC 编译标志有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!