artus9033
artus9033

Reputation: 631

Android NDK r10: std::string has not been declared

I'm having problems with the android ndk r10. I get the following: std::string has not been declared. I watched other forum threads like this, but nope of them helped me. My Application.mk looks like this:

    APP_PLATFORM := android-14
APP_ABI := armeabi-v7a # build for the ARM version of MCPE
APP_CFLAGS := -O2 -std=gnu99 # optimization level 2, use C99 (for decleations in for loops, etc)

APP_CPPFLAGS := -std=c++11
LOCAL_CFLAGS := -std=c++11
APP_STL := stlport_static

Please help me!

Upvotes: 0

Views: 1379

Answers (1)

18446744073709551615
18446744073709551615

Reputation: 16842

The class std::string has not been declared because it's not there. Unfortunately, there is no std::string in NDK. Some ports of std::string exist, I remember I found one or two, but finally I decided just not to use std::string. Why? Because we already have Java strings and C strings, Java strings come from JNI calls, C strings come from files, and if you introduce one more string type, it will be more conversion than usage.

EDIT: but read the comment below.

Upvotes: 1

Related Questions