Android compilation fails/Error: ccrandom.cpp

Android compilation fails/Error: ccrandom.cpp
0.0 0

#1

the problem as below:
Windows64
Cocos2dx3.5
NDK r10c
Error:

[armeabi]StaticLibrary:libcpufeatures.a
[armeabi]SharedLibrary:libMixProject.so
D:/168/game/MixProject/proj.android/jni/../../../../../cocos2d/cocos/./base/ccRandom.cpp:29:error:undefined reference to'std::__1::random_device:: random_device(std::__1::basic_string<char,std::__1::char_traits<char>,std::__1::allocator<char>>const&)'
D:/168/game/MixProject/proj.android/jni/../../../../../cocos2d/cocos/./base/ccRandom.cpp:30:error:undefined reference to'std::__1::random_device::operator()()'
D:/168/game/MixProject/proj.android/jni/../../../../../cocos2d/cocos/./base/ccRandom.cpp:32:error:undefined reference to'std::__1::random_device::~random_device()'
clang++.exe:error:linker command failed with exit code 1(use-v to see invocation)
/cygdrive/d/android-ndk-r10c/build/core/build-binary.mk:647:recipe for target'/cygdrive/d/168/game/MixProject/proj.android/obj/local/armeabi/libMixProject.so'failed
make:***[/cygdrive/d/168/game/MixProject/proj.android/obj/local/armeabi/libMixProject.so]Error 1

This is ccrandom.cpp

+****************************************************************************/
+

26 +#include “ccRandom.h”
27 +
28 +std::mt19937 &cocos2d::RandomHelper::getEngine() {
29 + static std::random_device seed_gen;
30 + static std::mt19937 engine(seed_gen());
31 + return engine;
32 +}


Sorry for my poor English.

Thanks in advance.


#2

Should I change the cocos/base/ccrandam.cpp ?


#3

when I change C++STASIC to gnu_STASIC in my application.mk.
there is another error as below:

C:/ndk/sources/cxx-stl/gnu-bibstdc++/4.9/include/bits/random.h:1590: error:undefined reference to ‘std::random_device::_M_init(std:::string const&)’

do anyone have the same problem with me?


#4

Is this problem solved?How?