Developers Manual > Cocos2d-x > Getting Started with Cocos2d-x > How to run cpp-tests on Linux

How to run cpp-tests on Linux

Environment Requirements

In this document, the variable cocos2dx_root means the root path of Cocos2d-x.

  • Install Dependencies

    The dependencies 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 dependencies manually.

  • Generate Makefile

    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

  • Compile

    Run make to compile:

    $ make
    

    Application will be generated in cocos2dx_root/build/linux-build/bin/cpp-tests/ if compiled auccessfully.

  • Run

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

    The Application should run like this:
    runningScene

folderImg.jpg (20.3 kB) owen, 2014-04-01 09:53

runningScene.jpg (53.4 kB) owen, 2014-04-01 09:53

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.