cocos2d-x3.2中2编译生成Android程序出错的解决方案:c++_static报错

最近升级到Cocos2d-x 3.2正式版,iOS程序编译没任何问题,结果使用cocos compile -p android编译生成APK程序,结果悲剧了,出现以下错误。

Android NDK: Invalid APP_STL value: c++_static

Android NDK: Please use one of the following instead:  system stlport_static stlport_static_hard stlport_shared stlport_shared_hard gnustl_static gnustl_shared gabi++_static gabi++_shared libc++_static libc++_shared none

make: Entering directory `/game/physics_engine/proj.android‘

/sdk/ndk/android-ndk-r9c/build/core/add-application.mk:274: *** Android NDK: Aborting    .  Stop.

make: Leaving directory `/game/physics_engine/proj.android‘

Error running command, return code: 2

很显然,这个错误是使用了不正确的STL Library,解决方案有如下两个。

方案1:临时方案

修改Application.mk文件,将原来的前4行替换为如下的内容。然后替换就ok了

原来的内容如下:

APP_STL := c++_static

NDK_TOOLCHAIN_VERSION=clang

APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char

APP_LDFLAGS := -latomic

替换后的内容如下:

APP_STL := gnustl_static

APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char

方案2:

由于c++_static只有在最新的NDK中才可使用,所以下载最新的NDK就可以了

太坑了!!!cocos2dx 3.2,有点怀念cocos2dx3.1.1的日子了,呜呜~

不懂的可以加我的QQ群: 239982941(cocos2d-x 3.x学习群)欢迎你的到来哦,看了博文给点脚印呗,谢谢啦~~

时间: 2024-08-23 17:28:53

cocos2d-x3.2中2编译生成Android程序出错的解决方案:c++_static报错的相关文章

Cocos2d-x 3.2编译生成Android程序出错的解决方案:c++_static报错

最近升级到Cocos2d-x 3.2正式版,iOS程序编译没任何问题,结果使用cocos compile -p android编译生成APK程序,结果悲剧了,出现以下错误. Android NDK: Invalid APP_STL value: c++_static Android NDK: Please use one of the following instead:  system stlport_static stlport_static_hard stlport_shared stlp

Cocos2d-x 3.2编译生成Android程序出错的解决方案

最近升级到Cocos2d-x 3.2正式版,iOS程序编译没任何问题,结果使用cocos compile -p android编译生成APK程序,结果悲剧了,出现以下错误. Android NDK: Invalid APP_STL value: c++_static Android NDK: Please use one of the following instead:  system stlport_static stlport_static_hard stlport_shared stlp

Cocos2d-x 3.2编译生成Android程序出错Error running command, return code: 2的解决方法

用Cocos2d-x 3.2正式版创建项目,结果使用cocos compile -p android编译生成APK程序,结果悲剧了,出现以下错误. Android NDK: Invalid APP_STL value: c++_static Android NDK: Please use one of the following instead:  system stlport_static stlport_static_hard stlport_shared stlport_shared_ha

ADT中,运行Android程序出错:The connection to adb is down, and a severe error has occured

原文地址:http://www.crifan.com/android_adt_the_connection_to_adb_is_down__and_a_severe_error_has_occured/ [总结] 出现 The connection to adb is down, and a severe error has occured 的问题,主要是由于adb没法正常运行起来: 而adb没法运行起来,主要是其端口被占用了: 常见的,可能的占用adb端口的,是你当前电脑上和手机相关的管理软件

[Android]通过js方法回调部分native报错 Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'

在android4.2以前,注入步骤如下: webview.getSetting().setJavaScriptEnable(true); class JsObject { public String toString() { return "injectedObject"; } } webView.addJavascriptInterface(new JsObject(), "injectedObject"); Android4.2及以后,注入步骤如下: webv

VS2013编写的C#程序,在xp下会报错说“不是合法的win32程序”。

VS2013编写的程序,在xp下会报错说“不是合法的win32程序”. 这个用C++编写的程序可以经过设置后在XP下运行,主要的“平台工具集”里修改就可以.方法见: http://blog.csdn.net/civilman/article/details/40109685 但是,用C#编写的程序,项目属性里是没有“平台工具集”的选项的,运行时会报错说不是正常的win32程序. DotNet版本为2.0,在xp下已经安装dotnet20. 请问,有谁知道如何让VS2013编写的C#程序在XP下运

【Android】Android import和export使用说明 及 export报错:jarlist.cache: Resource is out of sync with the file syst解决

在Android开发export项目时发现有时会报错,内容如下: Problems were encountered during export:  Error exporting PalmIdentify/bin/jarlist.cache: Resource is out of sync with the file system: '/PalmIdentify/bin/jarlist.cache'.    Resource is out of sync with the file syste

在android 中开发java.net.SocketException: socket failed: EACCES (Permission denied) 报错

在android中下载文件,写好下载文件的代码后需要配置相应的权限 <uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 按原则来说这样就应该可以正常下载了,但是在android4.2 模拟器上运行(貌似4.0以上的模拟器都有

Android引入support-v7-appcompat包values文件夹报错解决

在使用Eclipse编译时,当我们为了使自己的应用能够兼容更低版本的SDK的时候,就需要使用的谷歌为我们提供的support系列支持包. 谷歌这样做的目的就是能够使安卓SDK永远能向下兼容,并且让程序员不用去更多的纠结版本适应问题而专心于自己代码功能的实现. (简直业界良心啊!) 然而在我们引用支持包的时候,经常会被下面的异常困扰: 下面我分享一下我的解决思路: 1.确定到自己的支持包的版本号,步骤很简单: (1)打开自己的sdk Manager界面: 可以查看到最新的支持包版本,如果要更新,那