ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
来源:互联网 发布:实现省市区三级联动js 编辑:程序博客网 时间:2024/05/10 14:35
一、编译报错
external/yaffs2/yaffs2/yaffs_tagsvalidity.h:23:6: warning: redundant redeclaration of ‘yaffs_InitialiseTags’ [-Wredundant-decls]
external/yaffs2/yaffs2/yaffs_guts.h:888:6: note: previous declaration of ‘yaffs_InitialiseTags’ was here
host C: mkyaffs2image <= external/yaffs2/yaffs2/yaffs_tagsvalidity.c
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
In file included from external/yaffs2/yaffs2/yaffs_tagsvalidity.c:17:0:
external/yaffs2/yaffs2/yaffs_tagsvalidity.h:23:6: warning: redundant redeclaration of ‘yaffs_InitialiseTags’ [-Wredundant-decls]
external/yaffs2/yaffs2/yaffs_guts.h:888:6: note: previous declaration of ‘yaffs_InitialiseTags’ was here
host C: parseStringTest <= external/srec/tools/parseStringTest/parseStringTest.c
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1
make: *** Waiting for unfinished jobs....
host C++: post_trace <= sdk/emulator/qtools/post_trace.cpp
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
二、解决方法
问题原因:ubuntu 12.04中的gcc版本为4.6版本过高,需要降级为4.4
操作方法:
1. 查看gcc版本和g++版本
xumingtao@huaserver1:/usr/bin$ ls -l gcc*
lrwxrwxrwx 1 root root 7 Aug 30 19:26 gcc -> gcc-4.6
-rwxr-xr-x 1 root root 353216 Apr 16 07:37 gcc-4.6
xumingtao@huaserver1:/usr/bin$ ls -l g++*
lrwxrwxrwx 1 root root 7 Mar 14 04:05 g++ -> g++-4.6
-rwxr-xr-x 1 root root 357312 Apr 16 07:36 g++-4.6
2. 安装gcc和g++ 4.4版本
sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib
3. 修改gcc链接
sudo mv gcc gcc.bak
sudo ln -s gcc-4.4 gcc
xumingtao@huaserver1:/usr/bin$ ls -l gcc*
lrwxrwxrwx 1 root root 7 Sep 6 10:43 gcc -> gcc-4.4
-rwxr-xr-x 1 root root 259232 Apr 16 14:20 gcc-4.4
-rwxr-xr-x 1 root root 353216 Apr 16 07:37 gcc-4.6
lrwxrwxrwx 1 root root 7 Aug 30 19:26 gcc.bak -> gcc-4.6
4. 修改g++链接
sudo mv g++ g++.bak
sudo ln -s g++-4.4 g++
xumingtao@huaserver1:/usr/bin$ ls -l g++*
lrwxrwxrwx 1 root root 7 Sep 6 10:45 g++ -> g++-4.4
-rwxr-xr-x 1 root root 263328 Apr 16 14:18 g++-4.4
-rwxr-xr-x 1 root root 357312 Apr 16 07:36 g++-4.6
lrwxrwxrwx 1 root root 7 Mar 14 04:05 g++.bak -> g++-4.6
5.查看gcc和g++版本号
gcc-v
g++-v
三、OK!
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- ubuntu 12.04编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- Ubuntu 编译android GCC降级
- gcc 降级的解决方法
- ubuntu下CUDA编译的GCC降级安装
- Android源码编译时,遇到的问题:error: "_FORTIFY_SOURCE" redefined [-Werror]
- Ubuntu下的gcc降级
- Ubuntu 12.04 LTS server 编译 android-4.0.4_r2.1遇到的问题和解决方法
- ubuntu 12.04 编译uImage遇到的问题与解决方法
- Android 编译错误之: warning: "_FORTIFY_SOURCE" redefined
- ubuntu gcc 降级和升级
- linux的gcc降级
- 64bits Ubuntu下编译Android的步骤,所遇到的问题和解决方法
- ubuntu 14.04 gcc 版本的更新以及降级
- Ubuntu 12.04 error: "_FORTIFY_SOURCE" redefined [-Werror]
- ubuntu 12.04 编译android 2.3遇到的问题
- C++常识解析汇总
- 北斗卫星导航系统简介
- 关于经济人物终身成就奖获得者郭鹤年讲话的感想
- android开发知识汇总
- vc2005运行库解析
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- Linux 启动全接触
- !!!Chapter 15 Object-Oriented Programming (15.3 ~ 15.5)
- VS2008中MySQL数据库操作实例
- HTTP返回状态值详解
- 不成功Apple应用的经验教训总结——App Store创赢艺术
- Java正则表达式校验邮箱和手机号
- 大小端检测方法(ARM 和linux系统)
- ubuntu 12.10 上 android 编译环境搭建