c++ - 我正在尝试安装 gameplay 游戏引擎,但遇到错误

标签 c++ linux cmake gameplay3d

我正尝试在我的 ubuntuMATE 17.10 上安装gameplay 游戏引擎,按照以下步骤 here .在 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

最佳答案

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/”→ gameplay-build/被上传为 gameplay-build_ubuntu16_amd64.tar.gz (240MB)。可以解压到/home/*中任意位置

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

关于c++ - 我正在尝试安装 gameplay 游戏引擎,但遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49203141/

相关文章:

c++ - 从 Objective-C 类 .m 调用 .cpp 文件

c++ - 无法在abs函数c++中使用字符串长度函数

c++ - 一个应用程序中同一库的两个版本

linux - Bash - 从零开始的 Linux,cheching 库脚本

linux - 如何为 bash 命令设置多个环境变量

c++ - CMake 可以使用 c++ 而不是 mpicxx 来编译我的代码吗?

c++ - 从 shared_pointers 映射中填充 vector

linux - 无法启动红est。 System.IO.IOException : Failed to bind to address http://127.0.0.1:5000: address already in use

c - 使用 CMake 在 CLion 中构建引发错误

CMAKE/MAKEFILE :/usr/bin/x86_64-linux-gnu-ld : Cannot find -lfftw3f