cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.21k stars 7.06k forks source link

I suggest an additional explanation in the "Build and run a new project for Linux" section. #18488

Open qusghcks123 opened 6 years ago

qusghcks123 commented 6 years ago

Currently described manual:

If you never run cocos2d-x on Linux, you need to install all the dependencies by the script in cocos2d / build / install-deps-linux.sh

$ cd cocos2d-x / build $ ./install-deps-linux.sh

Then

$ cd NEW_PROJECTS_DIR / MyGame $ cocos run -p linux

Run

$ bin / MyGame

I followed this, but I had difficulty building and running the project, and I hope these commands will be modified slightly.

suggestion: $ mkdir -p ~ / Projects / Cocos $ mv ~ / Downloads / cocos2d-x-3.15.1.zip ~ / Projects / Cocos $ cd ~ / Projects / Cocos $ unzip cocos2d-x-3.15.1.zip $ cd ~ / Projects / Cocos / cocos2d-x-3.15.1 $ python setup.py $ source ~ / .bashrc $ cd ~ / Projects / Cocos / cocos2d-x-3.15.1 / tools / cocos2d-console / bin $ chmod + x cocos $ cocos $ chmod + x ~ / Projects / Cocos / cocos2d-x-3.15.1 / build / install-deps-linux.sh $ chmod + x ~ / Projects / Cocos / cocos2d-x-3.15.1 / tools / travis-scripts / instal_glfw.sh $ sudo apt-get update $ cd ~ / Projects / Cocos / cocos2d-x-3.15.1 / build $ sudo ./install-deps-linux.sh $ cd ~ / Projects / Cocos $ cocos new TestGame -l cpp $ cocos run -s TestGame -p linux

I confirmed that typing these commands into the terminal would build and run.

I hope Linux users will have a little easier access to this project.

slackmoehrle commented 6 years ago

I can test these out next week to see how it compares to our current instructions.

slackmoehrle commented 6 years ago
$ cd ~ / Projects / Cocos / cocos2d-x-3.15.1 / tools / cocos2d-console / bin
$ chmod + x cocos
$ cocos
$ chmod + x ~ / Projects / Cocos / cocos2d-x-3.15.1 / build / install-deps-linux.sh
$ chmod + x ~ / Projects / Cocos / cocos2d-x-3.15.1 / tools / travis-scripts / instal_glfw.sh
$ sudo apt-get update

My initial thought is that this should not have to be done unless you have some weird permissions on your system, but I will try a clean Ubuntu install and see if this needs to be done.

slackmoehrle commented 6 years ago

I have an Ubuntu VM now. Firing it up to test this issue. Perhaps I can also test on Ubuntu 17.10.

slackmoehrle commented 6 years ago

I don't have this problem. Our provided instructions work for me. I am downloading an .iso of Ubuntu 16.04 and 17.10 and I will try completely from scratch. It will take me several hours to pull these images down.

slackmoehrle commented 6 years ago

OK, I cannot seem to get 16.04 installed in a virtual machine. It freaks out and consumes my whole macbook pro when booting.

I moved to 17.10 and that is working. I will update step by step as completed what works for me

  1. Installed 17.10 into a virtual machine. Ran software update until there were no more updates available.
  2. $ sudo apt-get install git
  3. $ git clone https://github.com/cocos2d/cocos2d-x.git
  4. $ cd cocos2d-x
  5. $ git submodule update --init
  6. $ git submodule update (a habit, should not be needed)
  7. $ ./download-deps.py failed, see 8.
  8. python was not installed: sudo apt-get install python
  9. re-execute $ ./download-deps.py
  10. $ cd build
  11. $ ./install-deps-linux.sh
  12. many errors of things not installed. failed
  13. $ sudo apt-get install libx11-dev libxmu-dev libglu1-mesa-dev libgl2ps-dev libxi-dev g++ libzip-dev libpng-dev libcurl4-gnutls-dev libfontconfig1-dev libsqlite3-dev libglew*-dev libssl-dev
  14. re-execute: $ ./install-deps-linux.sh
  15. failed missing gcc-4.9, g++4.9, libpng12-dev We are going to need to modify this script to depend on newer versions of these items to complete. Researching this.
ThatUdeshUK commented 5 years ago

I can't build too since libpng12-dev is not available on Debian Buster. Installing libpng-dev doesn't work either.