LuaRocks fPIC 错误

发布于 2025-01-02 21:58:11 字数 497 浏览 5 评论 0原文

我正在尝试使用 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 不太好,我不确定如何或在何处添加此内容,或者,如果我做错了其他事情。任何帮助将不胜感激!

I'm trying to install numlua with luarocks:

luarocks make numlua-0.3-1.rockspec

but am getting the following error:

/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

I'm guessing I need to add the -fPIC argument as a flag but not being great with compilers and a first-timer with luaRocks I'm not sure how or where to add this, or, if there is something else I'm doing wrong. Any help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

大姐,你呐 2025-01-09 21:58:11

根据此邮件列表讨论,看起来 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 应该可以正常编译。

Per this mailing list discussion, it looks like LuaRocks is configured for a 32-bit system while actually running on a 64-bit system. It's likely that you installed it via a package manager, as this shouldn't happen when installed from source.

Find your luarocks/config.lua file. On my Ubuntu 11.10 system, it was located at /usr/share/lua/5.1/luarocks/config.lua. Find the line that says LUAROCKS_UNAME_M and change the i686 to x86_64.

Now that luarocks knows it's on a 64-bit machine, numlua should compile fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文