I installed these dependencies as described here:
sudo apt-get install g++ libgdk-pixbuf2.0-dev python-pip cmake libx11-dev libxmu-dev libglu1-mesa-dev libgl2ps-dev libxi-dev libzip-dev libpng-dev libcurl4-gnutls-dev libfontconfig1-dev libsqlite3-dev libglew-dev libssl-dev libgtk-3-dev libglfw3 libglfw3-dev xorg-dev
In cocos2d-x-3.16/cocos/platform/desktop/CCGLViewImpl-desktop.h
I had to change #include "glfw3.h"
to #include "GLFW/glfw3.h"
And got this:
[ 68%] Linking CXX executable …/…/bin/cpp-empty-test/cpp-empty-test
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btSequentialImpulseConstraintSolver.o): relocation R_X86_64_32 against.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btTypedConstraint.o): relocation R_X86_64_32S against symbol
_ZTV17btTypedConstraint’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btDiscreteDynamicsWorld.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btRigidBody.o): relocation R_X86_64_32S against symbol
_ZN17btCollisionObject17setCollisionShapeEP16btCollisionShape’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btConeTwistConstraint.o): relocation R_X86_64_32S against symbol_ZTV21btConeTwistConstraint' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletDynamics.a(btGeneric6DofConstraint.o): relocation R_X86_64_32S against symbol
_ZTV23btGeneric6DofConstraint’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btDbvtBroadphase.o): relocation R_X86_64_32S against symbol_ZTV16btDbvtBroadphase' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btOverlappingPairCache.o): relocation R_X86_64_32S against
.rodata’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCollisionDispatcher.o): relocation R_X86_64_32S against symbol_ZTV23btCollisionPairCallback' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCollisionObject.o): relocation R_X86_64_32S against symbol
_ZTV17btCollisionObject’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCollisionWorld.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btDefaultCollisionConfiguration.o): relocation R_X86_64_32S against symbol
_ZTV31btDefaultCollisionConfiguration’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btEmptyCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV16btEmptyAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btGhostObject.o): relocation R_X86_64_32S against symbol
_ZTV13btGhostObject’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btManifoldResult.o): relocation R_X86_64_32S against symbol_ZTV16btManifoldResult' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btSimulationIslandManager.o): relocation R_X86_64_32S against symbol
_ZTV25btSimulationIslandManager’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btSphereSphereCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV32btSphereSphereCollisionAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btSphereTriangleCollisionAlgorithm.o): relocation R_X86_64_32S against symbol
_ZTV34btSphereTriangleCollisionAlgorithm’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btUnionFind.o): relocation R_X86_64_32 against symbol__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(SphereTriangleDetector.o): relocation R_X86_64_32S against symbol
_ZTV22SphereTriangleDetector’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btBvhTriangleMeshShape.o): relocation R_X86_64_32S against symbol_ZTV22btBvhTriangleMeshShape' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCollisionShape.o): relocation R_X86_64_32S against symbol
_ZNK16btCollisionShape17getBoundingSphereER9btVector3Rf’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexInternalShape.o): relocation R_X86_64_32S against symbol_ZNK21btConvexInternalShape9getMarginEv' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexShape.o): relocation R_X86_64_32S against symbol
_ZTV13btConvexShape’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btOptimizedBvh.o): relocation R_X86_64_32S against symbol_ZTV14btOptimizedBvh' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btSphereShape.o): relocation R_X86_64_32S against symbol
_ZNK13btSphereShape37localGetSupportingVertexWithoutMarginERK9btVector3’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btTriangleMeshShape.o): relocation R_X86_64_32S against symbol_ZTV19btTriangleMeshShape' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btContinuousConvexCollision.o): relocation R_X86_64_32S against symbol
_ZTV27btContinuousConvexCollision’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btGjkConvexCast.o): relocation R_X86_64_32S against symbol_ZTV16btPointCollector' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btGjkPairDetector.o): relocation R_X86_64_32S against symbol
_ZTV17btGjkPairDetector’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btMinkowskiPenetrationDepthSolver.o): relocation R_X86_64_32 against.bss' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btRaycastCallback.o): relocation R_X86_64_32S against symbol
_ZTV15btTriangleShape’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btSubSimplexConvexCast.o): relocation R_X86_64_32S against symbol_ZTV22btSubsimplexConvexCast' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btVoronoiSimplexSolver.o): relocation R_X86_64_32S against
.rodata’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV20btCollisionAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btDbvt.o): relocation R_X86_64_32S against symbol
_ZN6btDbvt6IClone9CloneLeafEP10btDbvtNode’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btQuantizedBvh.o): relocation R_X86_64_32S against symbol_ZTV14btQuantizedBvh' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btActivatingCollisionAlgorithm.o): relocation R_X86_64_32S against symbol
_ZTV30btActivatingCollisionAlgorithm’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btBoxBoxCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV26btBoxBoxCollisionAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btBoxBoxDetector.o): relocation R_X86_64_32S against symbol
_ZTV16btBoxBoxDetector’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCompoundCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV28btCompoundCollisionAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btCompoundCompoundCollisionAlgorithm.o): relocation R_X86_64_32S against symbol
_ZN36btCompoundCompoundCollisionAlgorithm22getAllContactManifoldsER20btAlignedObjectArrayIP20btPersistentManifoldE’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexConcaveCollisionAlgorithm.o): relocation R_X86_64_32S against.rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexConvexAlgorithm.o): relocation R_X86_64_32S against symbol
_ZTV23btConvexConvexAlgorithm’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexPlaneCollisionAlgorithm.o): relocation R_X86_64_32S against symbol_ZTV31btConvexPlaneCollisionAlgorithm' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btHashedSimplePairCache.o): relocation R_X86_64_32S against symbol
_ZTV23btHashedSimplePairCache’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConcaveShape.o): relocation R_X86_64_32S against symbol_ZTV14btConcaveShape' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btPolyhedralConvexShape.o): relocation R_X86_64_32S against
.bss’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btGjkEpa2.o): relocation R_X86_64_32 against symbol_ZNK13btConvexShape31localGetSupportVertexNonVirtualERK9btVector3' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btPolyhedralContactClipping.o): relocation R_X86_64_32S against symbol
_ZN15btStorageResult15addContactPointERK9btVector3S2_f’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libBulletCollision.a(btConvexPolyhedron.o): relocation R_X86_64_32S against symbol_ZTV18btConvexPolyhedron' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libLinearMath.a(btAlignedAllocator.o): relocation R_X86_64_32 against
.text’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: …/…/…/…/external/bullet/prebuilt/linux/64-bit/libLinearMath.a(btConvexHullComputer.o): relocation R_X86_64_32 against symbol__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../../external/bullet/prebuilt/linux/64-bit/libLinearMath.a(btQuickprof.o): relocation R_X86_64_32 against symbol
_ZN15CProfileManager4RootE’ can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/build.make:174: recipe for target ‘bin/cpp-empty-test/cpp-empty-test’ failed
make[2]: *** [bin/cpp-empty-test/cpp-empty-test] Error 1
CMakeFiles/Makefile2:466: recipe for target ‘tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/all’ failed
make[1]: *** [tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2