Can't make Cocos 2d-x on Ubuntu 14.04

I had problem with compiling it on 18.04, but people here told me that we supposed to do it using 12.04 or 14.04. Ok, no big deal, just install 14.04 I thought. Not so fast - still there problem. People, come on, there problems anywere.

I made it till make:

cocos2d-x1404

I use 17.10 and I have it working with a PR that I submitted. https://github.com/cocos2d/cocos2d-x-docs/pull/136 I’ll merge this and update production docs later tonight.

I’ve got approximately the same on 17.10:

[ 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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 shared 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

Can you send me all of your steps, please. I can’t reproduce this so far.

I see the problem, please share with me all the commands you ran, in order.

I created VirtualBox’s machine with 17.10.

Installed these packages, so that I can install Guest Additions: sudo apt-get install gcc make perl

Installed guest additons and added user to vboxusers group so that I can use shared folder: sudo '/media/joe/VBox_GAs_5.2.8/VBoxLinuxAdditions.run'
: usemod -aG vboxsf $(whoami)

Updated: sudo apt-get update && sudo apt-get upgrade -y

Rebooted.

Installed packages that you prescribed.

Went to buld directory, created linux-build,
cd linux-build,
cmake ../..,
make

Thanks, ok, VirtualBox might have an issue that doesn’t seem to exist in Fusion or Parallels. I can test it too, tomorrow. Still downloading the 18.04 daily. My internet connection is like 1mb. :slight_smile:

Answers are here:Can't make Cocos2d-x compile on Ubuntu 18.04