Cygwin:错误的reloc地址链接

2024-06-28 11:12:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在cygwin(最新可用版本)安装程序上安装这个python package,使用gcc,根本没有windows/microsoft组件。该包有许多依赖项,因此您可能需要一段时间才能尝试安装它。我想这个错误是常见的,你不需要复制这个问题来提供关于如何修复它的见解。在

我发现这个错误有好几个(全部?)。包装上的洛杉矶图书馆:

Making all in centrality
make[4]: Entering directory '/cygdrive/d/gdrive/Thesis/tech/urv tech/graph-tool-2.2.31/src/graph/centrality'
  CXX      graph_betweenness.lo
  CXX      graph_centrality_bind.lo
  CXX      graph_closeness.lo
  CXX      graph_eigentrust.lo
  CXX      graph_eigenvector.lo
  CXX      graph_hits.lo
  CXX      graph_katz.lo
  CXX      graph_pagerank.lo
  CXX      graph_trust_transitivity.lo
  CXXLD    libgraph_tool_centrality.la
/usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x182b): undefined reference to `graph_tool::GraphInterface::GetNumberOfVertices()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x19bd): undefined reference to `graph_tool::GraphInterface::GetNumberOfVertices()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1a68): undefined reference to `graph_tool::ValueException::ValueException(std::string const&)'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1a87): undefined reference to `graph_tool::ValueException::~ValueException()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1ad1): undefined reference to `graph_tool::ValueException::ValueException(std::string const&)'
/usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: .libs/graph_betweenness.o: bad reloc address 0x6 in section `.text$_ZN5boost16exception_detail10clone_baseD1Ev[__ZN5boost16exception_detail10clone_baseD1Ev]'
collect2: error: ld returned 1 exit status
Makefile:474: recipe for target 'libgraph_tool_centrality.la' failed

正如我所看到的.lo文件是被构建的,可能是不正确的,当要生成.la文件时,我会得到“bad reloc address”错误。换句话说,我的假设是由于.lo文件没有正确生成,.la构建失败。在

在做了一些研究后,我发现2009年报告并修复了此错误:

https://www.mail-archive.com/bug-binutils@gnu.org/msg07150.html

基于此,我了解到解决这个问题的一种方法是用-export动态标志替换python库用来安装自己的配置文件中的所有符号。我修改了两个文件:configure和{}

Configure具有此类导出动态引用,与其他设置相关:

export_dynamic_flag_spec_CXX='${wl}--export dynamic'

在配置.ac只有这个:

[MOD_LDFLAGS=“-module-避免版本-导出动态-无未定义-Wl,-E-Wl,--根据需要”]

我认为这是关键,因为它指的是LD标志。在

但是如果我这样做,项目似乎会破坏一条消息,说构建中使用的文件的libtool版本错误。在

^{pr2}$

在aclocal.m4中还提到,如果我尝试更改,则会导致与构建文件版本相关的其他问题。在

此外,在ltmain.sh中,如果某些库是用export dynamic标志生成的,则对它们进行验证。在

所以,这里有几点:

  • 模块尝试生成的.la和.lo库之间的区别是什么?

  • 我认为这个问题与静态和动态链接的差异有关,但真的不知道如何解决它。是否涉及其他设置?

  • 一般来说,有什么建议可以试试吗?


Tags: 文件textlo错误cxxexporttoolla