0

刚从 Löve 开始,我很喜欢它!我目前正在 Ubuntu 14.04 下对其进行测试。

我能够毫无问题地编译 love 0.8.0,但我在从 bitbucket 编译 0.9.2 时遇到问题。看来,我可能是被一个大灰狼吃掉了……

链接时出现此错误,原因是libturbojpeg

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

根据这个 StackOverflow 条目,似乎默认的 libturbojpeg 二进制文件通过 apt-get 安装在 Ubuntu 中:

tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -L libjpeg-turbo8-dev | grep libturbojpeg.a
/usr/lib/x86_64-linux-gnu/libturbojpeg.a
tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -l libjpeg-turbo8-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                Architecture           Description
+++-==================================-======================-======================-=========================================================================
ii  libjpeg-turbo8-dev:amd64           1.3.0-0ubuntu2         amd64                  Development files for the IJG JPEG library

不是用 编译的-fPIC,所以我想我必须得到它的源代码,用那个选项重新编译它,并在löve的构建过程中修改一些东西以指向编译的那个。

我是朝着正确的方向前进,还是我错过了什么?

问候,汤姆

PD:我想知道为什么在这种特定情况下需要使用 -fPIC 编译这个库......

   -fPIC
       If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the
       global offset table.  This option makes a difference on the m68k, PowerPC and SPARC.
4

1 回答 1

0

好吧,似乎更新到 0.9.2 标签使它工作:

hg update 0.9.2
./platform/unix/automagic 
./configure
make

在此处查看有关 bitbucket 的问题。

Alex Szpakowski:这并不能真正帮助解决确切的问题,但 LÖVE 0.9.2 不依赖或链接 libturbojpeg。LÖVE 存储库中的最新代码适用于 0.10.0,它具有与 0.9.2 不同的依赖项(并且尚未完成/发布。)如果您想为 Linux 编译 0.9.2(而不是使用 .deb 或PPA)你应该从这里下载源代码: https ://bitbucket.org/rude/love/downloads/love-0.9.2-linux-src.tar.gz ,或者更新到 Mercurial 中的 0.9.2 标签存储库并运行 automagic 等。

于 2015-04-01T16:16:22.567 回答