侧边栏壁纸
  • 累计撰写 85 篇文章
  • 累计创建 16 个标签
  • 累计收到 1 条评论

android平台JNI打印数据

秋山人家
2021-07-22 / 0 评论 / 0 点赞 / 895 阅读 / 689 字
温馨提示:
本文最后更新于 2021-07-22,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

头文件引用

#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} )


0

评论区