【发布时间】:2011-08-29 12:10:52
【问题描述】:
我在linux下尝试编译一段cpp代码,报错如下:
/tmp/ccIeh7Ta.o: In function `model::MulPLSA::EStep()':
mul_plsa.cpp:(.text+0xb12): relocation truncated to fit: R_X86_64_32S against symbol `model::MulPLSA::mItemLatRatDeno' defined in .bss section in /tmp/ccIeh7Ta.o
mul_plsa.cpp:(.text+0xb42): relocation truncated to fit: R_X86_64_32S against symbol `model::MulPLSA::mItemLatRatDeno' defined in .bss section in /tmp/ccIeh7Ta.o
/tmp/ccIeh7Ta.o: In function `model::MulPLSA::MStep()':
mul_plsa.cpp:(.text+0xcec): relocation truncated to fit: R_X86_64_32S against symbol `model::MulPLSA::mItemLatRatDeno' defined in .bss section in /tmp/ccIeh7Ta.o
collect2: ld returned 1 exit status
我的操作系统:Ubuntu 10.10
g++:gcc 版本 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
以前有人遇到过这个错误吗?谢谢。
程
【问题讨论】:
-
看看amiatypist.blogspot.com/2010/05/…可能有用...
-
博客在中国无效。我google了这个问题,发现编译的时候加上options -mcmodel=medium 可以解决这个问题。我这样做了,编译器抛出警告:/tmp/ccG10FOV.s:3107:警告:忽略 .lbss 的不正确部分类型。无论如何,它有效。
-
请给我们一个最小的例子。相关:stackoverflow.com/questions/10486116/…
标签: c++ g++ relocation