Chinaunix首页 | 论坛 | 博客
  • 博客访问: 462946
  • 博文数量: 83
  • 博客积分: 92
  • 博客等级: 民兵
  • 技术积分: 690
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 13:33
文章分类

全部博文(83)

文章存档

2014年(3)

2013年(59)

2012年(16)

2011年(5)

我的朋友

分类: Android平台

2013-04-25 18:13:28

在JNI的c文件中如果用到了#include  
然后用NDK 编译, ndk-build clean && ndk-build 提示error: utils/Log.h: No such file or directory
如果只是用到LOG功能

1 修改Android.mk文件配置,添加如下语句
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
2  在.c文件中修改为如下语句
//#include //  关闭此行

增加以下:
#include
#pragma once  
#define LOG_TAG "debug log"  
#define LOGI(fmt, args...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, fmt, ##args)  
#define LOGD(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, fmt, ##args)  
#define LOGE(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, fmt, ##args)


阅读(5928) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~