dictionary - C++ / JNI brace-enclosed initializer Map (Android NDK) -


i have engine write in c++ integrate jni in androidstudio. read & follow tutorials found.

in cpp file there header's import include 2 maps brace-enclosed initialized (just example):

the first 1 initiazed 2500 lines... second 1 :

std::map <stateenum, std::string> statetostring = {   { state_one, "state 1" },   { state_two, "state 2" },   { state_three, "state 3" },   { state_four, "state 4" } }; 

application.mk

app_abi     := app_stl     := stlport_static app_cflags  := -std=c++11 -fpic 

and here error :

jni/my_header.h:line: error: not convert '{{state_one, "state 1"}, {state_two, "state 2"}..} '< brace-enclosed initializer list>' 'std::map< stateenum, std::string>'

i tried compile c++ file library integrate android project. , result same.

anyone can me. didn't want translate 2500 lines of map initialization (with map.add(...)) 5000 lines.

stlport implementation out-of-date , don't support c++11 (in particular, brace initializers). should switch gnu libstdc++ or llvm libc++ implementation working:

app_stl := gnustl_static # gnu libstdc++ # or: app_stl := c++_static    # llvm libc++ 

Comments