error: 'LOGE' was not declared in this scope
移植了下HAL,发现编译出现如下错误
error: 'LOGE' was not declared in this scope
比较了一下android4.1的 system/core/include/cutils/log.h和android4.0的对应文件,
发现在4.1当中已经将所有的LOG宏前面加了一个字母A 。所以出现上述编译错误。
修改HAL层源码:将LOGE LOGD等等全部加个A
方法:
`grep LOG -rl .`
附上一个linux中的字符串查找替换用法:
Linux 下各种查找替换字符串的办法
2009-03-12 10:54:13| 分类: Linux |字号 订阅
1、在vi中使用的查找替换方法
利用 :s 命令可以实现字符串的替换。具体的用法包括:
:s/str1/str2/ 用字符串 str2 替换行中首次出现的字符串 str1
:s/str1/str2/g 用字符串 str2 替换行中所有出现的字符串 str1
:.,$ s/str1/str2/g 用字符串 str2 替换正文当前行到末尾所有出现的字符串 str1
:1,$ s/str1/str2/g 用字符串 str2 替换正文中所有出现的字符串 str1
:g/str1/s//str2/g 功能同上从上述替换命令可以看到:g 放在命令末尾,表示对搜索字符串的每次出现进行替换;不加 g,表示只对搜索字符串的首次出现进行替换;g 放在命令开头,表示对正文中所有包含搜索字符串的行进行替换操作。
2、在shell中使用find结合grep进行文件的替换
# find ./ -exec grep str1 ‘{}’ \; -exec sed -i.bak s/str1/str2/g ‘{}’ \;
上面命令可以在当前目录下(包括子目录)查找包含str1的文件,自动替换成str2,并且生成源文件的bak文件
3、sed Linux下批量替换多个文件中的字符串的简单方法
用sed命令可以批量替换多个文件中的字符串。
用sed命令可以批量替换多个文件中的字符串。
sed -i "s/原字符串/新字符串/g" `grep 原字符串 -rl 所在目录`
例如:我要把aaa替换为bbb,执行命令:
sed -i "s/aaa/bbb/g" 'grep aaa -rl /www'
这是目前linux最简单的批量替换字符串命令了!
具体格式如下:
sed -i "s/oldString/newString/g" `grep oldString -rl /path`
实例代码:sed -i "s/123/456/g" `grep 123 -rl /usr/aa`
sed -i "s/123/456/g" `grep 123 -rl ./`
千万注意:gerp前面的符号是Tab键上方的那个 ` ,而不是单引号!
error: 'LOGE' was not declared in this scope的更多相关文章
- c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow
c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow fcgio.cpp:50: error ...
- 【QT】error: 'SIGNAL' was not declared in this scope
error: 'SIGNAL' was not declared in this scope 未在此范围内声明. connect(ui->Btnshowhello,SIGNAL(clicked ...
- [Error] 'exit' was not declared in this scope的解决方法
新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...
- 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题
环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...
- 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope
Compile++ thumb : game_shared <= main.cpp jni/hellocpp/main.cpp: In function 'void Java_org_coco ...
- 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope
解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...
- In function 'int av_clipl_int32_c(int64_t)': error: 'UINT64_C' was not declared in this scope
cygwin下使用ndk编译jni时遇到的错误: /ffmpeg/include/libavutil/common.h: In function 'int av_clipl_int32_c(int64 ...
- error: ‘errno’ was not declared in this scope
问题: 将一个c文件改为cpp文件,其中的perror()改用C++中的std::cerr << strerror(error) << std::endl;来替换. 重新编译文 ...
- error: ‘to_string’ was not declared in this scope
错误: error: ‘to_string’ was not declared in this scope 原因: to_string是C++11引入的新功能,旧版本编译器可能不支持它,所以要给编译器 ...
随机推荐
- ios -- cell的图片下载
1.面试题 1> 如何防止一个url对应的图片重复下载 * “cell下载图片思路 – 有沙盒缓存” 2> SDWebImage的默认缓存时长是多少? * 1个星期 3> SDWeb ...
- jsp--文本框正则表达式
1.文本框只能输入数字代码(小数点也不能输入) <input onkeyup="this.value=this.value.replace(/\D/g,'')" onafte ...
- 严重: Exception starting filter struts2 java.lang.NullPointerException (转载)
严重: Exception starting filter struts2 java.lang.NullPointerException at com.opensymphony.xwork2.util ...
- 在Mac OS X中搭建STM32开发环境(2)
本文原创于http://www.cnblogs.com/humaoxiao,非法转载者请自重! 在上一篇文章中,我们在OSX中编译了ST-Link2调试工具,并且简单的对其功能进行了测试 ...
- [原创整理]这些术语你知道吗?(Web篇)
每一个术语代表的或是一种技术,或是一项标准,那么,作为混在IT界这个江湖的你,对这些术语熟悉么? 你知道它们所指代的事物么?你知道他们被创造的目的么?你了解了设计者的思想与精髓了么?亲,跟上时代的脚步 ...
- AVAudioRecorder 录制音频
AVFoundation 中使用AVAudioRecorder 类添加音频录制功能是非常简单的, AVAudioRecorder构建与Audio Queue Services之上是一个功能强大且代码简 ...
- PHP 递归创建目录
/* 用迭代的方法递归创建目录 其实在PHP5.0.0之后mkdir就已经能递归创建目录了. 这里主要是自己学习迭代,所以拿创建级联目录开刀了. 开发中应该写mkdir('./a/b/c/d/e',0 ...
- WPF中Application.Current的使用
WPF程序对应一个Application对象,当前的Application对象可以通过Application.Current获取,通过获取到的Application对象,我们可以做以下的事情: App ...
- JAVA String 类
java String类中的常用方法:public char charAt(int index)返回字符串中第index个字符:public int length()返回字符串的长度:public i ...
- 使用自定义 URL 实现控制器之间的跳转-b
一个app往往有很多界面,而界面之间的跳转也就是对应控制器的跳转,控制器的跳转一般有两种情况 push 或者 modal,push 和 modal 的默认效果是系统提供的 文章配图 1. 概述 系统提 ...