解决Error: undefined reference to `__android_log_print'

报如下的错:


解决Error: undefined reference to `__android_log_print


   在旧的Android Studio版本中,一般是在build.gradle中修改,但新版本了换为了CMakeLists.txt:需要这样修改:即新增“log-lib”


find_library( # Sets the name of the path variable.
log-lib

# Specifies the name of the NDK library that
# you want CMake to locate.
log )


target_link_libraries( # Specifies the target library.
imagePro-lib

# Links the target library to the log library
# included in the NDK.
${log-lib} )