libcutils.so
is not part of official native API, it is not distributed with NDK. You can pull it from any device or even from emulator, and it is reasonable stable across the versions and mods, so I will not discourage you from using it.
On the other hand, the linker would normally say
ld: error: cannot find -lcutils
collect2: ld returned 1 exit status
If it said undefined reference
, it probably found libcutils.so somewhere on its search path. Maybe, it was a wrong library. Maybe, you set LOCAL_LDLIBS
for a static library in your Android.mk, and therefore it is ignored.
LOCAL_LDLIBS
is only relevant for
include $(BUILD_SHARED_LIBRARY)
or
include $(BUILD_EXECUTABLE)