本文介绍了如何在执行./configure时设置ccshared = -fPIC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 QGIS 上构建Python 2.6 /en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux"rel =" noreferrer> RHEL 5.在制作QGIS的过程中,出现以下错误:

I am trying to build Python 2.6 for QGIS on RHEL 5.During the making of QGIS I get the following error:

Linking CXX shared library libqgispython.so
/usr/bin/ld: /usr/local/lib/python2.6/config/libpython2.6.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python2.6/config/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/python/libqgispython.so.1.0] Error 1
make[1]: *** [src/python/CMakeFiles/qgispython.dir/all] Error 2
make: *** [all] Error 2

我从此错误中发现的是,我需要使用一些标志-fPIC构建Python 2.6.是的,所以我在configure.in文件中找到了它,但是它检查了几种情况,并根据这些条件将-fPIC分配给CCSHARED标志.

What I figure out from this error is that I need to build Python 2.6 with some flag, -fPIC.OK, so I found it in the configure.in file but it checks several conditions and on the basis of those conditions it assigns -fPIC to the CCSHARED flag.

我所做的是,在检查完所有条件之后,我添加了以下行以故意将CCSHARED用作-fPIC.

What I did was that after all conditions were checked I added the following line to deliberately use CCSHARED as -fPIC.

CCSHARED="-fPIC";

但这没用.

在配置时如何指定要将CCSHARED设置为-fPIC的方式?

How to specify while configuring that I want to set CCSHARED as -fPIC?

推荐答案

使用--enable-shared运行配置.然后-fPIC将包含在共享标志中.

Run configure with --enable-shared. Then -fPIC will be included as part of the shared flags.

这篇关于如何在执行./configure时设置ccshared = -fPIC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 12:01