cocos2d-x3.2中2編譯產生Android程式出錯的解決方案:c++_static報錯

來源:互聯網
上載者:User

標籤:android   style   io   ar   color   os   使用   sp   檔案   

最近升級到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學習群)歡迎你的到來哦,看了博文給點腳印唄,謝謝啦~~


cocos2d-x3.2中2編譯產生Android程式出錯的解決方案:c++_static報錯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.