我正在尝试编译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。但这也没有帮助。所以如果有人解决了这个问题,请帮助。
由于
答案 0 :(得分:3)
它是由gcc 4.3的更改触发的,导致它与旧的glibc标头不兼容: http://lifecs.likai.org/2009/06/multiple-definition-of-extern-inline.html 从那篇文章中,快速解决方法是在CFLAGS中添加-fgnu89-inline:
./ configure --prefix = / usr --enable-shared --docdir = / usr / share / doc / ruby-2.2.3 ... CFLAGS = -fgnu89-inline
然后make应该工作。