移植了下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的更多相关文章

  1. 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 ...

  2. 【QT】error: 'SIGNAL' was not declared in this scope

    error: 'SIGNAL' was not declared in this scope  未在此范围内声明. connect(ui->Btnshowhello,SIGNAL(clicked ...

  3. [Error] 'exit' was not declared in this scope的解决方法

    新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...

  4. 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题

    环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...

  5. 编译是报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 ...

  6. 调用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 解决: ...

  7. 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 ...

  8. error: ‘errno’ was not declared in this scope

    问题: 将一个c文件改为cpp文件,其中的perror()改用C++中的std::cerr << strerror(error) << std::endl;来替换. 重新编译文 ...

  9. error: ‘to_string’ was not declared in this scope

    错误: error: ‘to_string’ was not declared in this scope 原因: to_string是C++11引入的新功能,旧版本编译器可能不支持它,所以要给编译器 ...

随机推荐

  1. 0708_Java如何设置输入流

    1.Java如何设置输入流:?(以解决看下面实例代码) 2.Java如何设置全局变量:(以解决public static即可) 3.Java为什么在做那种机试题目的时候都要设置成静态的:(以解决,因为 ...

  2. WIN8+VS2013编写发布WCF之一(编写)

      引言:上学期因为写服务器用WCF,所以连查资料再瞎调试勉强成功了,但是这学期又到了用WCF的时候,而当时的资料零零散散,查找不易,并且此次是在WIN8与VS2013环境下编写的,所以将该入门过程记 ...

  3. ###《High-level event recognition in unconstrained videos》

    Author: Yu-Gang Jiang, Shih-Fu Chang 事件检测的目标就是自动识别给定视频序列中的感兴趣事件.进行视频事件检测通常很困难,特别是在网络中非限制的视频.在非限制情况下, ...

  4. android 权限总结

    1.拨打电话要权限 2.sd目录存东西要权限

  5. HDU 4430 Yukari's Birthday(二分)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4430 题目大意:给定n个蜡烛,围绕蛋糕的中心插同心圆,从里往外分别是第1圈.第2圈....第r圈,第 ...

  6. BootstrapDialog点击空白处禁止关闭

    在乐学一百的项目当中引用到了BootstrapDialog,其中后台发送短信时,为了防止管理员编辑了半天的短息,突然间因为点击某个空白区域导致丢失,所以在此禁用掉点击空白关闭弹出框. 主要属性为: c ...

  7. 一套帮助你理解C语言的测试题(转)

    前言 原文链接:http://www.nowamagic.net/librarys/veda/detail/775 内容 在这个网站(http://stevenkobes.com/ctest.html ...

  8. SSH+Ajax实现用户名重复检查(二)

    1.另外一种更常用的js表达方式: var user = { inintEvent: function(){ $("input[name='user.User_LogName']" ...

  9. php用正则表达式获取网站的标题内容

    已知网站的网址,用php获取网站的内容. 编写正则表达式. 用preg_match_all函数获取标题内容. $url='http://www.m-ivi.com'; $content=file_ge ...

  10. CSS3 animation-fill-mode 属性

    现在专注于移动端开发项目,对于动画这个点是非常重要的,每当我遇到一个新的知识点,我就会和大家一起分享 animation-fill-mode :把物体动画地从一个地方移动到另一个地方,并让它停留在那里 ...