NDK SDL2_image libpng build error: png_init_filter_functions_neon


Windows 7 64-bit
Android Studio 3.1.4
JRE 1.8.0
Gradle 4.4
Grande Plugin 3.1.4
Compile SDK API 26
Build Tools version 27.0.3
SDL2 2.0.8
SDL2_image 2.0.3 (inside SDL2_image - libpng 1.6.32)

Native build with ndk throws this error message- any help?

C:/android-project/app/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libpng.a(pngrutil.o): In function png_init_filter_functions': C:/android-project/app/jni/SDL2_image/external/libpng-1.6.32/pngrutil.c:4113: undefined reference topng_init_filter_functions_neon’
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [C:/android-project/app/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libSDL2_image.so] Error 1

Any help greatly appreciated.

I’ve search internet with little direct help:

Forgot to add NDK version is r17)

Added this to Application.mk file and it’s builds now


Thanks so much for figuring this out. Took me a while to realise I was mistakenly adding it to Android.mk but when I re-read your post and correctly added it to Application.mk my app built again.