Building SDL for Android on Visual Studio


I’m following this tutorial but when trying to build (for ARM or ARM64 on both debug & release), these 2 errors happen:

E0020: identifier “__fp16” is undefined, arm_neon.h, l34
MSB6006: “clang.exe” exited with code 1., Android.Common.targets, l119

With ARM, there also is an extra error:
E1696: cannot open source file “cpu-features.h”, SDL_cpuinfo.c, l82
and 3 likely related undefined identifiers. In the SDL2 source I’ve downloaded from here, I didn’t find that file. What did I do wrong?

Hi, I just stumbled upon the same problem: it seems that latest Android NDK (>r15) removed the file cpu-features.h so you need to comment or remove the lines referring to that. I found this patch that fixes the build for me.