undefined reference to `__android_log_print' undefined reference to `__android_log_print' android android

undefined reference to `__android_log_print'


You need to add

LOCAL_LDLIBS := -llog

to Android.mk


Try the following in your Android.mk file:

LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog


If you use Android Studio and gradle, it ignores Android.mk. Add this to your build.gradle file:

android {    defaultConfig {        ndk {            moduleName "your_module_name"            ldLibs "log"        }    }}