调试lib库的一些小技巧

来源:互联网 发布:淘宝主页设计多少钱 编辑:程序博客网 时间:2024/05/21 10:48

 

1.    lib库中打印log信息
在文件头部加
#define LOG_TAG “testme”
#undef LOG   //
有的版本需要这句,有的版本不需要
#include <utils/Log.h>

在程序中用
LOGE(“log is xxxxx”);
在编lib库的Android.mk中加
LOCAL_SHARED_LIBRARIES:=libutils

2.    lib库中jnic++
在每个函数前头加,以免提示找不到函数名

#ifdef __cplusplus
extern “C”
#endif