Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 1.72 KB

File metadata and controls

72 lines (49 loc) · 1.72 KB

How to Run Cpp-tests on Linux

Overview##

The document will show you how to compile & run cpp-tests on Linux.
In the document, the variable cocos2dx_root means the root path of cocos2d-x.

Document Scope

The document is suitable for version v3.0rc or newer.

Steps

  • Install Dependences

    The dependenced libraries are:

      libx11-dev
      libxmu-dev
      libglu1-mesa-dev
      libgl2ps-dev
      libxi-dev
      g++
      libzip-dev
      libpng12-dev
      libcurl4-gnutls-dev
      libfontconfig1-dev
      libsqlite3-dev
      libglew*-dev
      libssl-dev
    

    If you are using Ubuntu/Debian, there is a shell script (build/install-deps-linux.sh) for you to install the dependences easily. Run commands below in terminal:

      $ cd $cocos2dx_root/build
      $ ./install-deps-linux.sh
    

    Otherwise, you should install the depences by yourself.

  • Generate makefile

    After the dependened libs are installed, run cmake to generate makefile:

      $ mkdir linux-build
      $ cd linux-build
      $ cmake ../..
    

    When cmake returns correctly, many files & folders will be generated in coocs2dx_root/build/linux-build:

    folderImg

  • Compiling

    Run make to compile

      $ make
    

    Application will be generated in cocos2dx_root/build/linux-build/bin/cpp-tests/ if compile correctly.

  • Run cpp-tests

      $ cd bin/cpp-tests/
      $ ./cpp-tests
    

    You will see the application is running like this: runningScene