【问题标题】:I am trying to install gameplay game engine ,But encountered an error我正在尝试安装gameplay游戏引擎,但遇到错误
【发布时间】:2018-03-09 22:27:29
【问题描述】:

我正在尝试按照here 的步骤在我的 ubuntuMATE 17.10 上安装 gameplay 游戏引擎。在cmake 之后我输入make 并得到以下错误:

/usr/bin/ld: /home/samdare/Downloads/extracts/GamePlay-master/external-deps/lib/linux/x86_64/libgameplay-deps.a(btVoronoiSimplexSolver.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/samdare/Downloads/extracts/GamePlay-master/external-deps/lib/linux/x86_64/libgameplay-deps.a(SphereTriangleDetector.o): relocation R_X86_64_32S against symbol `_ZTV22SphereTriangleDetector' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/samdare/Downloads/extracts/GamePlay-master/external-deps/lib/linux/x86_64/libgameplay-deps.a(trees.o): relocation R_X86_64_32S against symbol `_length_code' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
samples/browser/CMakeFiles/sample-browser.dir/build.make:745: recipe for target 'samples/browser/sample-browser' failed
make[2]: *** [samples/browser/sample-browser] Error 1
CMakeFiles/Makefile2:235: recipe for target 'samples/browser/CMakeFiles/sample-browser.dir/all' failed
make[1]: *** [samples/browser/CMakeFiles/sample-browser.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

【问题讨论】:

  • 链接器建议“使用 -fPIC 重新编译”。您是否尝试过添加该选项?
  • 奇怪:对象将在基于 rpm 的操作系统中正常链接,例如PCLinuxOS 2017. Ubuntu:也许用 -fPIC github.com/gameplay3d/GamePlay-deps 重建 libgameplay-deps

标签: c++ linux cmake gameplay3d


【解决方案1】:

GamePlay : Ubuntu 16.04 - amd64 中的链接器可以正常使用 GamePlay。

sudo apt install g++ cmake libglu1-mesa-dev libogg-dev libopenal-dev libgtk2.0-dev curl lib32z1-dev

git clone https://github.com/gameplay3d/GamePlay.git
cd GamePlay/
./install.sh
mkdir build && cd build/ && cmake .. && make

已创建可执行文件:

build/samples/browser/sample-browser
build/samples/racer/sample-racer
build/samples/character/sample-character
build/samples/spaceship/sample-spaceship

Ubuntu 16.04 文件似乎与 Ubuntu 17.10 - amd64 完美配合。我的结果 "build/" → games-build/ 被上传为 gameplay-build_ubuntu16_amd64.tar.gz (240MB) 。可以解压到/home/*中的任意位置

链接https://drive.google.com/file/d/1EIggScf8bGdbBCTMOpjbmKbQcWgs0tpv/view?usp=sharing

【讨论】:

    猜你喜欢
    • 2022-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-23
    • 1970-01-01
    • 2013-08-06
    • 2020-09-05
    • 2020-02-17
    相关资源
    最近更新 更多