Android studio中JNI-NDK开发打印LOG出现 undefined reference to `__android_log_print' 解决
来源:互联网 发布:java期末考试题库 编辑:程序博客网 时间:2024/05/29 13:51
Android studio中JNI-NDK开发打印LOG出现 undefined reference to `__android_log_print'
出现问题如图:
解决方法:
修改build.gradle配置
工程中共有两个build.gradle配置文件,我们要修改的是在\app\build.gradle这个文件。
defaultConfig里面写入
ndk{
ldLibs "log", "z", "m"
}如图:
在C/C++代码中写入:
<span style="font-family:KaiTi_GB2312;font-size:18px;">#define LOG_TAG "System.out"#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)</span>如图:
0 0
- Android studio中JNI-NDK开发打印LOG出现 undefined reference to `__android_log_print' 解决
- android ndk添加打印 解决undefined reference to __android_log_print'问题
- Android Studio 下安卓 jni 开发错误 undefined reference to __android_log_print
- 使用android studio JNI报错 undefined reference to '__android_log_print'
- Android NDK 编译时候出现 undefined reference to `__android_log_print
- android-studio undefined reference to `__android_log_print
- android studio undefined reference to `__android_log_print'
- jni编译问题:jin中添加LOG方法以及undefined reference to `__android_log_print'错误
- jni中出现使用LOGD,出现undefined reference to '__android_log_print错误
- undefined reference to `__android_log_print'解决
- undefined reference to `__android_log_print'解决
- undefined reference to `__android_log_print'解决
- undefined reference to `__android_log_print'解决
- undefined reference to `__android_log_print'解决
- undefined reference to `__android_log_print'解决
- 安卓 jni 开发错误 undefined reference to __android_log_print
- Visual GDB进行Android NDK开发,报错:error : undefined reference to '__android_log_print' 解决办法
- "android-studio undefined reference to `__android_log_print "错误解决方法
- Android UI之RatingBar
- UVA_10970_BigChocolate
- struct与union字节对齐问题
- 为Xcode6添加Empty Application选项
- 黑马程序员—反射机制
- Android studio中JNI-NDK开发打印LOG出现 undefined reference to `__android_log_print' 解决
- leetcode 9: Palindrome Number
- lintcode-有效回文字符串
- NSAttributedString几个用法
- 中断,异常,硬件断点
- [转]谈谈我对攻读计算机研究生的看法
- android__实践(短信发送器)
- ubuntu apt-get update 更新源失败的解决办法
- HDU-2066 一个人的旅行