how to compile and run cocos2dx in linux

I believe for android development, linux is much better than windows. Originally development in visual studio then porting to android using cgywin is not as convenient as develop both together in linux eclipse, besides, linux and mac totally supports gcc environment while windows always has some different grammer with it.   That' s why I am interested in porting cocos2dx to linux. 

I think most task of it have been done for a version only for development.  however, lack of test to find some bugs.

well Here is the step to build cocos2dx in linux

1. get it from github

the version haven't been merged with the main master in github (I believe walzer will merge it in a short time)

you could: 

git clone https://github.com/laschweinski/cocos2d-x.git

git checkout LinuxPort


2.install some dependent libs:

glfw and zlib is essentially required by cocos2dx:

in ubuntu,

sudo apt-get install libglfw-dev

while cocosdenshion---the sound cocos lib need fmod lib.

(fmod lib is a gpl lib, but I pay more attention to its mp3 support. )

the libs have been in CocosDenshion/third_party/fmod/api/lib

so you could manually copy it to /usr/lib

or simply, 

sudo sh installLinux.sh

do the same thing

3. compile cocos2dx and cocosDenshion

I am a eclipse lover, every development is based on eclipse, and not very familiar with cmake or makefile. 

therefore now, you had better compile it within the help of eclipse

File->import->exsisting projects

select cocos2dx root directory, path to cocos2dx/proj.linux

and compile it, if it is successed, it will automatically move the libs into cocos2dx/lib/linux

(post.sh in the root complete the task, while I configure it in eclipse build steps)

for cocosDenshion:

the project folder is cocosDenshion/proj.linux


4. run helloworld:

also the directory is in [cocos2d-x]/HelloWorld/linux

configure a build variable:

right click HelloWorld project->preference->c/c++ Build->Build variables

modify cocos2dx_loc to the root directory of cocos2dx (in my case, it is /home/laschweinski/git/cocos2d-x)


5. run the test:

the project is in  [cocos2d-x]]tests/test.linux

run it without any configuration



Thanks for your attention to this port and cocos2dx



  

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值