【问题标题】:LuaRocks fPIC errorLuaRocks fPIC 错误
【发布时间】:2012-02-26 12:26:16
【问题描述】:

我正在尝试使用 luarocks 安装 numlua:

luarocks make numlua-0.3-1.rockspec

但出现以下错误:

/usr/bin/ld: numlua.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
numlua.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
cp: cannot stat `numlua.so': No such file or directory

我猜我需要将 -fPIC 参数添加为标志,但不适用于编译器和 luaRocks 的初学者我不确定如何或在何处添加它,或者,如果还有其他东西我做错了。任何帮助将不胜感激!

【问题讨论】:

    标签: lua compiler-errors luarocks


    【解决方案1】:

    根据this mailing list discussion,看起来 LuaRocks 是为 32 位系统配置的,而实际上是在 64 位系统上运行的。您可能是通过包管理器安装它的,因为从源代码安装时不会发生这种情况。

    找到您的 luarocks/config.lua 文件。在我的 Ubuntu 11.10 系统上,它位于 /usr/share/lua/5.1/luarocks/config.lua。找到写着LUAROCKS_UNAME_M 的行并将i686 更改为x86_64

    既然 luarocks 知道它在 64 位机器上,numlua 应该可以正常编译。

    【讨论】:

    • 理想情况下,发布 LuaRocks 的发行版的用户应该将错误报告发布到他们选择的发行版。这将对我们所有人都有帮助!
    猜你喜欢
    • 2014-07-26
    • 2016-03-25
    • 2015-03-06
    • 2018-12-07
    • 2018-11-29
    • 2014-01-13
    • 2016-07-15
    • 2015-06-02
    • 2021-01-28
    相关资源
    最近更新 更多