linux_cocos2dx_环境搭建

我的windows崩溃了,各种烦,没办法,到linux下来搞cocos2d开发吧

首先下载了个cocos2d的源码2.2.1

#表示cocos2d目录吧


然后unzip#.zip

#目录下运行./make-all-linux-project.sh


于是生成#/lib/debug/..a ..so


但是


../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidNodeCreateTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:256:49:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidNodeDeallocTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:308:49:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteCreateEmptyTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:365:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteCreateTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:419:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteDeallocTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:473:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]


有个这个错误,所以编译就停止了


所以

#lib/release/... 好像没有生成


后来我在#目录下运行Makefile文件

生成了lib/release/...a..so


但是也是上面的错误


../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidNodeCreateTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:256:49:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidNodeDeallocTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:308:49:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteCreateEmptyTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:365:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteCreateTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:419:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]

../Classes/PerformanceTest/PerformanceAllocTest.cpp:In member function ‘virtual voidSpriteDeallocTest::initWithQuantityOfNodes(unsigned int)’:

../Classes/PerformanceTest/PerformanceAllocTest.cpp:473:51:error: format ‘%lu’ expects argument of type ‘long unsignedint’, but argument 2 has type ‘unsigned int’ [-Werror=format]


总之都是这个字符串format问题

error: format ‘%lu’ expectsargument of type ‘long unsigned int’, but argument 2 has type‘unsigned int’ [-Werror=format]


Makefile里面的那一行改呢,我不清楚


下面看看能不能用python建立一个HelloWorld项目,看看能不能运行,因为之前的debugrelease下的链接文件都是生成了的,

只有在Sample/Cpp/...这个目录下的没有完全生成,可能就是一个编译选项的问题(我没有必要怀疑源代码吧?)


但是我没有找到哪里改。。。先不管。。。


python创建项目

python#/tools/project-creator/create_project.py


这里我忘了怎么敲了

但是

提示非常给力

Usage: create_project.py -projectPROJECT_NAME -package PACKAGE_NAME -language PROGRAMING_LANGUAGE

Options:

-project PROJECT_NAME Project name, for example: MyGame

-package PACKAGE_NAME Package name, for example: com.MyCompany.MyAwesomeGame

-language PROGRAMING_LANGUAGE Major programing lanauge you want to used, should be [cpp | lua |javascript]


Sample 1: ./create_project.py -projectMyGame -package com.MyCompany.AwesomeGame

Sample 2: ./create_project.py -projectMyGame -package com.MyCompany.AwesomeGame -language javascript


./create_project.py -project HelloWorld-package com.boss.helloworld

-language cpp


然后cd#/projects/HelloWorld/proj.linux

make 一下

cd #/projects/HelloWorld/proj.linux/bin

敲下./HelloWorld


运行成功


虽然有点小问题但是成功了一半了,上面一个问题留给以后解决!


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值