【问题标题】:Problems with libturbojpeg compiling love-0.9.2libturbojpeg 编译 love-0.9.2 的问题
【发布时间】:2015-06-06 08:55:02
【问题描述】:

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

我能够毫无问题地编译 love 0.8.0,但我在从 bitbucket 编译 0.9.2 时遇到问题。 看来,我可能是eaten by a grue...

链接时出现此错误,由于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

根据this StackOverflow entry,似乎是通过apt-get在Ubuntu中安装了默认的libturbojpeg二进制:

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.

【问题讨论】:

    标签: linker love2d fpic


    【解决方案1】:

    嗯,看来更新到 0.9.2 标签让它工作了:

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

    检查 here 以了解有关 bitbucket 的问题。

    亚历克斯·斯帕科夫斯基: 这并不能真正帮助解决确切的问题,但是 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 标签并运行 自动魔法等。

    【讨论】:

      猜你喜欢
      • 2011-11-30
      • 2013-09-17
      • 2012-07-06
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      • 2017-07-13
      • 2012-10-09
      • 1970-01-01
      相关资源
      最近更新 更多