gpt4 book ai didi

Ruby eventmachine 编译错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:52 24 4
gpt4 key购买 nike

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 机器上完成的。

有什么建议吗?提前致谢!

最佳答案

我在尝试在标准的 debian squeeze 安装上构建 mosh-1.2.2 时遇到了类似的问题。以下对我有用:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# rm libstdc++.so
# ln -s ../../../x86_64-linux-gnu/libstdc++.so.6 libstdc++.so

更详细地解释一下,现有的符号链接(symbolic link)指向一个不存在的文件:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# ls -l libstdc++.so
..
lrwxrwxrwx 1 root root 23 May 3 2011 libstdc++.so -> ../../../libstdc++.so.6
..

我找到了正确的文件位置

# dpkg -S 'libstdc'
..
libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
..

然后按照第一个代码段中的描述修复符号链接(symbolic link)。

我在编译过程中遇到的错误是:

make[3]: *** [mosh-client] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
/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

不知道这个特殊的 debian squeeze 服务器是怎么坏的。我一直在毫无问题地在其他挤压系统上进行编译。

关于Ruby eventmachine 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8021876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com