Can't make Cocos2d-x compile on Ubuntu 18.04

I looked at the steps before when you and I talked about this via a GitHub issue and I think there are so many travis-cl steps that are not needed, except for when using travis-cl. My goal was to try and make the Linux build process less complicated and easier for us to maintain as the latest distros are changing slightly with each release, package names, locations, dependencies, etc.

Why there:
Why there instructions to add older repos to 17.x and 18.x ?
First of all - it’s probably not safe to mess with packages for older release on a newer release.
And there no problems with finding any of those packages - no necessary to add ‘xenial main’.

Add a repo to /etc/apt/sources.list

```sh
deb http://cz.archive.ubuntu.com/ubuntu xenial main
```

And still don’t get about Python package - could you tell exactly where and what to change, thanks.

on 18, I am removing that line. it snuck in

on 17, it is required.

For python on 16 and 17 it is called python2.7 on 18 it is called python-minimal.

Here is the PR: https://github.com/cocos2d/cocos2d-x-docs/pull/142 and the docs are re-deploying to production. Usually takes 20 minutes.

I downloaded again through git, repeated steps form updated documentation and it went further, it seems everything gonna be alright this time.

Success. Thank you very much !!! :smiley:

1 Like

Absolutely. Let me know if you need anything else.

1 Like

excuse me. I’m new in here but this thread is related to my problem. I repeated steps from offical cocos gitbook (especialy for ubuntu 18.04). But i still get the same error at make -j 4 command. And the error is same as above this thread.

This looks like it isn’t installing all the deps…

hmm… what i’m missed for. i run install-deps-linux.sh and i got this. I’m sure i’ve installed libpng-dev. My ubuntu is 18.04.

but the instructions don’t say to do this for 18.x :slight_smile:

ok i downloaded again through git, repeated steps from documentation and i still get the same error (in this case i don’t run ./install-deps-linux.sh). I’m sure i run git submodule update --init, git submodule update, ./download-deps.py, download the dependency, and then build the makefile for linux-build as the documentation.

Ok let me test on a clean Ubuntu 18.04 install.

thank you. I try to install with zip from cocos website, build the make file as the step from documentation, and the build is complete (I still don’t know and wondering why). But when i try to run the binary cpp-tests it’s say the error like this.

According to this thread i’m finaly solve the problem.

But i still wondering why it’s failed to build when cloning from git repository.

I’ll run through the instructions again just to be sure.

I didn’t run into any issues, but in the sake of not leaving someone hanging I added the thread you referenced to the docs. This PR

Hi,
i’m relaunching this thread because it looks like this problem is not solved.
I have reinstalled cocos2d-x (following the documentation’s instructions) on my Ubuntu 18.04, and had the exact same error than Gdrop.

[ 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-
etc…

Then i did the exact same thing than doyoque (install from the zip form cocos website)
and now the error occures at 98% of the compilation.
I really want to fix this issues, if you have any what this error is related to , it would be very nice

Linux is my primary platform, these days.

You need to add this to your CMakeLists:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie -fexceptions -std=c++11 -Wno-deprecated-declarations -Wno-reorder")

1 Like

AH it works, thanks :slight_smile:
maybe it can be useful to add it to the linux install documentation, only for ubuntu 18 users