fixing undefined reference to __srget for NDK-r10c

sign up sign in

First time, when I heard of snowkit, I fall in love to snow. It is nice, easy and low-level haxe library to develop games and applications. While some important to me features are missing (async network requests on native platforms, for example), it is still worth to try.

I playing a bit with web builds and native builds, but every time I tried to build any app for android, compiler error appears, something like ... undefined reference to __srget ...

I searched a bit, and found that this function (and some others) is removed from android ndk-r10. Some people propose to install older ndk-r9d, but I don’t like this approach.

Long time I thought that this is flow / snow problem (because openfl can export to android without any problems). But some time ago I REALLY wanted to run show app on android, so I spent a couple of minutes, and suddenly turned out that it is not flow / snow, but hxcpp problem. Android .so libraries inside hxcpp from haxelib was build using older android ndk.

Luckily, it is very easy to fix. Just open terminal, go to hxcpp folder (usually it is /usr/lib/haxe/lib/hxcpp/<hxcpp version>), and execute

cd project  
neko build.n android  

After a few minutes I be able to run snow sample on my Android phone :)