Android ndk undefined reference to "std::chrono::system_clock::now()"

Linker fails when building for android (Windows build and linking doesn’t have any problem).
Not even warnings generated during compilation.

No idea what is actually wrong since rest of c++11 seems to work correctly.


LogPlayLevel:Display: UnrealBuildTool: Compiling with NDK API 'android-19'  

LogPlayLevel:Display: UnrealBuildTool: Performing 1 actions (max 4 parallel jobs)  

LogPlayLevel:Display: UnrealBuildTool: [1/1] clang++.exe Summer2014-armv7.so  

LogPlayLevel:Display: UnrealBuildTool: W:/Unreal Projects/Summer2014/Source/Summer2014/Util/Timer.cpp:40: error: undefined reference to 'std::chrono::_V2::system_clock::now()'  

LogPlayLevel:Display: UnrealBuildTool: W:/Unreal Projects/Summer2014/Source/Summer2014/Util/Timer.cpp:40: error: undefined reference to 'std::chrono::_V2::system_clock::now()'  

LogPlayLevel:Display: UnrealBuildTool: W:/Unreal Projects/Summer2014/Source/Summer2014/Util/Timer.cpp:40: error: undefined reference to 'std::chrono::_V2::system_clock::now()'  

LogPlayLevel:Display: UnrealBuildTool: W:/Unreal Projects/Summer2014/Source/Summer2014/Util/Timer.cpp:49: error: undefined reference to 'std::chrono::_V2::system_clock::now()'  

LogPlayLevel:Display: UnrealBuildTool: clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

We required custom timer since built-in is unavailable outside UObjects and some of our code doesn’t have any need for UObject but still needs timer.

Using Unreal Engine 4.2 and Tegra Dev Pack is installed.

6 Years Later… If anyone encounters this linker error, here is the problem.

UE4 as of 4.24 and earlier uses the android STL gnustl_shared when compiling with the NDK. The problem then is that when you are linking against libraries that have been compiled with a different STL. For instance, compiling a library against libc++ shared or static will produce the linker error seen above because these libraries have incomplete implementations of std::chrono.

The solution is to build your libraries against the same STL that UE4 uses, gnustl_shared. If for some reason you cannot compile your libraries against this then you have a difficult task of possibly changing the STL that UE4 uses, good luck there. For those that can compile against gnustl_shared, this often means changing your libraries cmake invocation to include something in the ballpark of:
-DANDROID_STL=gnustl_shared.

The invocation will differ based on your library and the parameters that the devs set forth to adjust this at build time, check the documentation to see what parameter they use to change the android STL. The example above was for the amazon GameLift c++ client.