Coco2d-x linux编译

Linux Environment Setup

Linux development can be done either with Eclipse (and its managed make system) or with regular Makefiles. This pages describes the Makefile approach.

The Linux build of cocos2dx is mostly used unser Debian/Ubuntu-based systems. Use on other distributions will probably work fine but YMMV.

To build cocos2dx you need the following packages intalled:

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

The top level script "make-all-linux-project.sh" will check for these and attempt to install them for you.

Building

make-all-linux-project.sh will then do a clean build of all projects in both Debug and Release configuration. To build just one configurations you can just use 'make'. e.g.:

$ make -j5 DEBUG=1

This will build all cocos2dx libraries and examples in debug mode. Libraries are build into the 'lib/linux/Debug' folder.

If you just want to build a single library or a single example just run 'make' from the proj.linux folder for that library or example. e.g:

$ cd samples/Cpp/TestCpp/proj.linux && make -j5 DEBUG=1

Remember to add the -j argument when you run make to dramatically speed up your build time.

Running

The makefiles provided include a 'run' target which can be used to run the build executable. e.g.:

$ cd samples/Cpp/TestCpp/proj.linux && make -j5 DEBUG=1 run

Creating a new project

One simple way to create a new project is to copy the 'samples/Cpp/HelloCpp/proj.linux' folder into your project. Once here you will need to edit parts of the Makefile accordingly (at the very least the SOURCES). If you are building outside the cocos2dx tree then you will need to set $COCOS2DX_ROOT either within your Makefile or in your environment.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值