Ruby eventmachine 编译错误
在 ruby 1.9.2-p290
上编译 eventmachine 0.12.10
时,我收到以下错误输出:
g++ -shared -o rubyeventmachine.so binder.o cmain.o cplusplus.o ed.o em.o emwin.o epoll.o files.o kb.o page.o pipe.o rubymain.o sigs.o ssl.o -L. -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -Wl,-R/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -lruby -lssl -lcrypto -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
这是在运行 debian squeeze 的 Linux 机器上完成的。
有什么建议吗?提前致谢!
I'm getting the following error output when compiling eventmachine 0.12.10
on ruby 1.9.2-p290
:
g++ -shared -o rubyeventmachine.so binder.o cmain.o cplusplus.o ed.o em.o emwin.o epoll.o files.o kb.o page.o pipe.o rubymain.o sigs.o ssl.o -L. -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -Wl,-R/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -lruby -lssl -lcrypto -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
This is done on a linux machine running debian squeeze.
Any suggestions? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在尝试在标准 debian squeeze 安装上构建 mosh-1.2.2 时遇到了类似的问题。以下内容对我有用:
为了更详细地解释,现有的符号链接指向一个不存在的文件:
我找到了正确的文件位置
然后按照第一个代码段中的描述修复了符号链接。
我在编译过程中遇到的错误是:
不知道这个特定的 Debian 挤压服务器是如何崩溃的。我一直在其他挤压系统上进行编译,没有遇到任何问题。
I had a similar issue trying to build mosh-1.2.2 on a standard debian squeeze installation. The following worked for me:
To explain in a more detail, the existing symlink was pointing to a non-existent file:
I located the correct file location
Then repaired the symlink as described in the first code segment.
The error I was getting during compiling was:
No idea how this particular debian squeeze server broke. I've been compiling on other squeeze systems with no trouble.
您的
gcc
安装错误。特别是,您在
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/
中有libstdc++.a
,但(显然)不是libstdc++ .so
.libstdc++.a
中的代码不是使用-fPIC
标志构建的,因此您无法将该代码链接到共享库。Your
gcc
installation is bad.In particular, you have
libstdc++.a
in/usr/lib/gcc/x86_64-linux-gnu/4.4.5/
, but (apparently) notlibstdc++.so
.The code in
libstdc++.a
was not built with-fPIC
flag, and so you can't link that code in to a shared library.我在尝试使用
rvm
或therubyracer 0.9.9
安装ree 1.8.7-2012.02
时遇到了同样的问题。你写的最后一条评论让我能够正确修复它,我只需使用下一个命令将 g++ 更新到测试版本:有关使用不同版本的软件包保留 debian 系统的更多信息,请参阅 debian 文档 如何保持混合系统
I got the same problem when trying to install
ree 1.8.7-2012.02
withrvm
ortherubyracer 0.9.9
. The last comment you wrote make me able to correctly fix it, I just use the next command to update g++ to the testing version :For more informations about keeping a debian system with packages from different releases is in the debian doc How to keep a mixed system
升级到 ruby 2.2.3 解决了我的问题
upgrading to ruby 2.2.3 resolved the issue for me