Cocos2d-x 3.0 编译出错 解决 error: expected ';' at end of member declaration
2015-02-21 09:25
495 查看
近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似“error: expected ';' at end of member declaration”之类的,看了一些编译错误,都是cocos2d-x库里面的代码出错。
经过分析,怀疑可能是编译环境的问题,由于cocos2d-x使用了非常多C++11的新特性,这有可能导致老的编译器出错,看了一下NDK以下的文件以及toolchains里面的内容,windows编译器默认使用4.6,我尝试把4.6改成4.8再次编译不报错了,成功了,把改动的地方分享给大家一下。
在项目->属性以下,改动成下图的样子就可以。
即把builder setting改成ndk-build NDK_TOOLCHAIN_VERSION=4.8
经过分析,怀疑可能是编译环境的问题,由于cocos2d-x使用了非常多C++11的新特性,这有可能导致老的编译器出错,看了一下NDK以下的文件以及toolchains里面的内容,windows编译器默认使用4.6,我尝试把4.6改成4.8再次编译不报错了,成功了,把改动的地方分享给大家一下。
在项目->属性以下,改动成下图的样子就可以。
即把builder setting改成ndk-build NDK_TOOLCHAIN_VERSION=4.8
相关文章推荐
- Cocos2d-x 3.0 编译出错 解决 error: expected '' at end of member declaration
- Cocos2d-x 3.0 TestCpp android编译出错 解决 error: expected ';' at end of member declaration
- Cocos2d-x 3.0 编译出错 解决 error: expected ';' at end of member declaration
- cocos2d-x-2.2.5 Eclipse编译报错 error: 'transform' is not a member of 'std' (IOS没有问题)
- 解决Error: junk at end of line, first unrecognized character is `@'
- error: At end of source: #67: expected a "}"
- error: expected declaration or statement at end of input
- error: expected declaration or statement at end of input----solved
- 怎样解决错误:error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value
- 【解决】SPECCPU编译出错“f951: error: argument to '-O' should be a non-negative integer”
- 编译飞凌ok335D开发板内核时出现drivers/mfd/ezx-pcap.c:205:2: error: implicit declaration of function 'irq_to_gpio
- 使用友元,编译出错fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) 的解决
- Hessain调用expected end of map ('z') at '?'错误原因
- “ error: expected declaration or statement at end of input/n warning: control reaches end of non-void function”
- error: expected declaration or statement at end of input----solved
- 编译海思3520内核时候报错drivers/mfd/ezx-pcap.c:205:2: error: implicit declaration of function 'irq_to_gpio' [-
- 移植出错:eeti_ts.c:64: error: implicit declaration of function 'irq_to_gpio'
- c++config.h:43: error: expected unqualified-id before 'namespace'解决
- VS2008下编译错误(error C2065: '_S1max' : undeclared identifier)的解决办法
- error: expected declaration specifiers or '...' before xxx(xxx是函数形参)