Cocos2d-x 3.2 compiled to generate Android program error solution, cocos2d-xandroid

Source: Internet
Author: User

Cocos2d-x 3.2 compiled to generate Android program error solution, cocos2d-xandroid

Recently upgraded to the official version of Cocos2d-x 3.2, iOS program compilation is no problem, the Results Use cocos compile-p android compiler to generate the APK program, the results of the tragedy, the following error occurs.

Android NDK: Invalid APP_STL value: c ++ _ static

Android NDK: Please use one of the following instead: system stlport_static 1_stlport_shared 1_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


Obviously, this error is caused by incorrect STL Library. There are two solutions.


Solution 1: temporary solution


Modify the Application. mk file and replace the first four lines with the following content. Then replace it with OK.


The original content is as follows:

APP_STL: = c ++ _ static
NDK_TOOLCHAIN_VERSION = clang

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


The content after replacement is as follows:

APP_STL: = gnustl_static

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


Solution 2:

C ++ _ static is only available in the latest NDK, so you can download the latest NDK.


You can.


An error occurred while using ndk cross-compilation after cocos2d-x 201 generated the android Project

Because the eclipse version is incompatible with the ndk version, the ndk version you are using is relatively new. If r8e version exists, this problem is not solved, or you can. add the following code in mk: APP_CPPFLAGS + =-Wno-error = format-security. You can use the r8e package on your own. I will not advertise it.

Cocos2d-x 32alpha Lua project created in android platform cannot be transplanted Problems

When Cocos 3.0 creates the default Lua project, its Android project is very incomplete. The generated project template. C ++ compilation is not included at all.
Your exception actually tells you that the SO file is not generated in the libs directory of your project.
I also tried to modify the default Android Project template in the past, but the modification volume was too large, and it took a long time to complete the modification.
My advice to you is not to use Cocos to create a Lua project. Just create a common C ++ project. After compiling a common C ++ project, you can get the SO library under the libs directory.
For Android Lua projects, it does not need C ++ code, but a SO library file,
With this SO library file, the rest is easy to handle.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.