NDK SDL2_image libpng build error: png_init_filter_functions_neon

Environment

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:
https://www.bing.com/search?q=undefined+reference+to+`png_init_filter_functions_neon’&qs=n&form=QBRE&sp=-1&pq=undefined+reference+to+`png_init_filter_functions_neon’&sc=0-55&sk=&cvid=07F12498F5164CDDB09118E878700A73

Forgot to add NDK version is r17)

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

APP_CFLAGS += -DPNG_ARM_NEON_OPT=0

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.