C ++ 11 random library in Android JNI

I am trying to compile an Android application with a native component that uses the C ++ library random.

My Application.mkfile:

APP_STL := stlport_static
APP_CPPFLAGS += -std=gnu++11
NDK_TOOLCHAIN_VERSION := 4.8

When compiling, I get an error message:

[armeabi] Compile++ thumb: Project <= main.cpp
/home/user/project/main.cpp:12:18: fatal error: random: No such file or directory
#include <random>

Is the library available randomfor Android?

+4
source share
1 answer

APP_STL: = stlport_static

APP_CPPFLAGS + = -std = gnu ++ 11

NDK_TOOLCHAIN_VERSION: = 4.8

You are creating STLPort again - which, as far as I can tell, is an implementation of the standard C ++ 03 library. Therefore, it will not have C ++ 11 headers.

From other parameters, you might think:

APP_STL:= gnustl_static

or

APP_STL:= c++_static

GNU libstd ++ LLVM lib++ . GPL ( Google libstd ++ ), lib++. , , , .

+1

Source: https://habr.com/ru/post/1617843/


All Articles