zoukankan      html  css  js  c++  java
  • 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 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就能够了


    大家能够从http://developer.android.com/tools/sdk/ndk/index.html下载最新的NDK版本号,然后重新设定ndk路径可以是。

    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    js插入html
    $.ajax()的使用
    [ORGINAL]datePicker OPP style based on web. for desktop applications.
    [orginal] OOP tab control based on web !!
    [ORGINAL]OPP spin box ( numeric up down control) Design based on web!!
    [orginal] slide bar based on web , from ABC
    [orginal] OOP treeView based on web.
    [ORGINAL]OOP Panel control design(based on web )
    Autofocus
    [orginal] OOP group Box control based on WEB.!!!
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4618462.html
Copyright © 2011-2022 走看看