【发布时间】: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