I am using android NDK r8d and eclipse Juno. I am trying to compile C ++ code that uses C ++ 11, e.g. mutex , lock_guard , shared_ptr , etc. In an Android own project in eclipse.
I get errors like:
"error: 'shared_ptr' is not a member of 'std'"
"fatal error: mutex: no such file or directory"
I came across a similar question here . They seem to work for them, but the explanation is not complete there, so I can't get it to work for me.
I added "NDK_TOOLCHAIN_VERSION=4.7" to the Application.mk file and "LOCAL_CFLAGS += -std=c++11" to Android.mk . However, it does not compile.
The link above says:
"Make sure that the path is included in the standard library (for example, / android -ndk-r8d / sources / cxx-stl / gnu-libstdc ++ / 4.7 / include) in the target settings."
How and where to insert it?
I also get errors in the Eclipse IDE (in the source code before compilation). I know that I have to define "__GXX_EXPERIMENTAL_CXX0X__" to solve them, but I just don't know where to put it.
So, if someone can post an answer with a full explanation of how to compile and make eclipse work with C ++ 11, it would be great.
c ++ gcc c ++ 11 smart-pointers android-ndk
DeathlessHorsie Mar 07 '13 at 11:04 on 2013-03-07 11:04
source share