android平台JNI打印数据
头文件引用
#include <android/log.h>
#define LOG_TAG "android_printf"
//日志等级
//ANDROID_LOG_DEBUG
//ANDROID_LOG_INFO
//ANDROID_LOG_WARN
//ANDROID_LOG_ERROR
#define LOGEE(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG ,__VA_ARGS__)
#在CmakeLists.txt中添加
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.
native-lib
# Links the target library to the log library
# included in the NDK.
${log-lib} )
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 银河驿站
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果