我正在尝试编译 ruby-2.2.3。我已经下载了软件包并进行了配置。但是当我尝试制作它时,它抛出了以下错误:
compiling main.c
/tmp/cc2lrvgn.s: Assembler messages:
/tmp/cc2lrvgn.s:413: Error: symbol `pread64' is already defined
make: *** [main.o] Error 1
以下是我的系统详细信息:
$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.10 (Final)
Release: 5.10
Codename: Final
以下是我使用的编译器的版本信息:
gcc --version
gcc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我对这个错误做了一些调查,发现这个错误存在于 libc- 标题。我试图升级 libc-headers。但这也无济于事。所以如果有人解决了这个问题,请帮忙。
谢谢
最佳答案
它是由 gcc 4.3 中的一个更改触发的,该更改导致它与旧的 glibc header 不兼容: http://lifecs.likai.org/2009/06/multiple-definition-of-extern-inline.html 从那篇文章中,一个快速的解决方法是将 -fgnu89-inline 添加到您的 CFLAGS:
./configure --prefix=/usr --enable-shared --docdir=/usr/share/doc/ruby-2.2.3 ... CFLAGS=-fgnu89-inline
然后 make 就可以了。
关于ruby - 错误 : symbol `pread64' is already defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32325334/