Ubuntu 12.04 编译Android 4.0.3 的环境配置
2013-06-14 09:23
716 查看
http://www.linuxidc.com/Linux/2012-11/73918.htm
[日期:2012-11-10]
来源:Linux社区 作者:lylianlll
[字体:大 中 小]
本来不喜欢写博客的,在Ubuntu 12.04 下编译了Android 4.0.3发现了一大堆错误,网上找了一堆的更改源码啊,Android.mk的解决方法,虽然可以编译成功,但都有点坑爹的成分,为了不误人子弟就分享出来吧。
根本原因是因为gcc的版本太高,ubuntu 12.04的系统带版本是4.6 的要求严格了,稍微有点不注意就报错。 解决方法就是降级到gcc4.4.
还有就是默认的linux系统调用的头文件路径不是标准的,例如/usr/include/i386-linux-gnu/sys
啥都别废话了, 先装下面的一堆依赖库再说
sudo apt-get -y install lib64quadmath0 lib64gomp1 lib64gcc1 libc6-amd64 libc6-dev-amd64 gcc-multilib gcc-4.6-multilib libc-bin libc-dev-bin libc6-dev libc6 build-essential linux-headers-generic linux-libc-dev libmpfr-dev libmpfr libgmp-dev libgmp uboot-mkimage
u-boot-tools libglib2.0-dev libpcre3-dev git-man liberror-perl git git-core tree gperf fakeroot dkms libgsoap1 libpthread-stubs0-dev libpthread-stubs0 libx11-dev subversion vim g++ bison openjdk zlib1g-dev flex libncurses5-dev gcc-4.4 g++-4.4 g++-4.4-multilib
装完后,开始降级gcc , 放心,这不会影响到系统的情绪,就改个链接而已,不喜欢的话改回来就好
cd /usr/bin
sudo mv gcc gcc.bk
sudo ln -s gcc-4.4 gcc
sudo mv g++ g++.bk
sudo ln -s g++-4.4 g++
好了~~~完成,可以完美编译了。
以上方法可以解决下面的一堆所谓坑爹的问题,哥也傻过了,你们就别傻改代码了啦
•错误: “_FORTIFY_SOURCE”重定义 [-Werror]
•external/mesa3d/src/glsl/linker.cpp:623:33: 警告: ‘virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)’所隐藏 [-Woverloaded-virtual]
external/mesa3d/src/glsl/linker.cpp: 在函数‘void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’中:
external/mesa3d/src/glsl/linker.cpp:1394:49: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1394:50: 错误: ‘varyings’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1394:58: 错误: ‘offsetof’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1395:48: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:48: 错误: ‘position’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1414:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1414:48: 错误: ‘pointSize’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1424:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1424:48: 错误: ‘position’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1428:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1428:48: 错误: ‘frontFacingPointCoord’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1431:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1431:48: 错误: ‘frontFacingPointCoord’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp: 在函数‘void link_shaders(const gl_context*, gl_shader_program*)’中:
external/mesa3d/src/glsl/linker.cpp:1734:49: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1734:50: 错误: ‘fragColor’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1734:59: 错误: ‘offsetof’在此作用域中尚未声明
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] 错误 1
•reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
external/oprofile/libpp/format_output.h
•external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
•In file included from external/gtest/src/../include/gtest/gtest-param-test.h:157:0,
from external/gtest/src/../include/gtest/gtest.h:69,
from external/gtest/src/gtest_main.cc:32:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
In file included from external/gtest/src/../include/gtest/gtest-param-test.h:157:0,
from external/gtest/src/../include/gtest/gtest.h:69,
from external/gtest/src/../src/gtest.cc:34,
from external/gtest/src/gtest-all.cc:36:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
In file included from external/gtest/src/gtest-all.cc:38:0:
•host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_export_foreach.cpp
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2012-11/73918.htm
[日期:2012-11-10]
来源:Linux社区 作者:lylianlll
[字体:大 中 小]
本来不喜欢写博客的,在Ubuntu 12.04 下编译了Android 4.0.3发现了一大堆错误,网上找了一堆的更改源码啊,Android.mk的解决方法,虽然可以编译成功,但都有点坑爹的成分,为了不误人子弟就分享出来吧。
根本原因是因为gcc的版本太高,ubuntu 12.04的系统带版本是4.6 的要求严格了,稍微有点不注意就报错。 解决方法就是降级到gcc4.4.
还有就是默认的linux系统调用的头文件路径不是标准的,例如/usr/include/i386-linux-gnu/sys
啥都别废话了, 先装下面的一堆依赖库再说
sudo apt-get -y install lib64quadmath0 lib64gomp1 lib64gcc1 libc6-amd64 libc6-dev-amd64 gcc-multilib gcc-4.6-multilib libc-bin libc-dev-bin libc6-dev libc6 build-essential linux-headers-generic linux-libc-dev libmpfr-dev libmpfr libgmp-dev libgmp uboot-mkimage
u-boot-tools libglib2.0-dev libpcre3-dev git-man liberror-perl git git-core tree gperf fakeroot dkms libgsoap1 libpthread-stubs0-dev libpthread-stubs0 libx11-dev subversion vim g++ bison openjdk zlib1g-dev flex libncurses5-dev gcc-4.4 g++-4.4 g++-4.4-multilib
装完后,开始降级gcc , 放心,这不会影响到系统的情绪,就改个链接而已,不喜欢的话改回来就好
cd /usr/bin
sudo mv gcc gcc.bk
sudo ln -s gcc-4.4 gcc
sudo mv g++ g++.bk
sudo ln -s g++-4.4 g++
好了~~~完成,可以完美编译了。
以上方法可以解决下面的一堆所谓坑爹的问题,哥也傻过了,你们就别傻改代码了啦
•错误: “_FORTIFY_SOURCE”重定义 [-Werror]
•external/mesa3d/src/glsl/linker.cpp:623:33: 警告: ‘virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)’所隐藏 [-Woverloaded-virtual]
external/mesa3d/src/glsl/linker.cpp: 在函数‘void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’中:
external/mesa3d/src/glsl/linker.cpp:1394:49: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1394:50: 错误: ‘varyings’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1394:58: 错误: ‘offsetof’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1395:48: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:48: 错误: ‘position’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1414:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1414:48: 错误: ‘pointSize’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1424:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1424:48: 错误: ‘position’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1428:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1428:48: 错误: ‘frontFacingPointCoord’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1431:47: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1431:48: 错误: ‘frontFacingPointCoord’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp: 在函数‘void link_shaders(const gl_context*, gl_shader_program*)’中:
external/mesa3d/src/glsl/linker.cpp:1734:49: 错误: expected primary-expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1734:50: 错误: ‘fragColor’在此作用域中尚未声明
external/mesa3d/src/glsl/linker.cpp:1734:59: 错误: ‘offsetof’在此作用域中尚未声明
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] 错误 1
•reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
external/oprofile/libpp/format_output.h
•external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
•In file included from external/gtest/src/../include/gtest/gtest-param-test.h:157:0,
from external/gtest/src/../include/gtest/gtest.h:69,
from external/gtest/src/gtest_main.cc:32:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
In file included from external/gtest/src/../include/gtest/gtest-param-test.h:157:0,
from external/gtest/src/../include/gtest/gtest.h:69,
from external/gtest/src/../src/gtest.cc:34,
from external/gtest/src/gtest-all.cc:36:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
In file included from external/gtest/src/gtest-all.cc:38:0:
•host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_export_foreach.cpp
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2012-11/73918.htm
相关文章推荐
- Ubuntu 12.04 编译Android 4.0.3 的环境配置
- ubuntu 12.04 amd64 编译android源码的JAVA环境配置
- Android 编译环境配置搭建(Ubuntu 12.04)及环境导致编译错误QA
- Ubuntu 12.04 64bit 配置完android 5.0编译环境后出现“could not write bytes: Broken pipe.”而无法进入输入帐号密码的登陆界面
- Android 编译环境配置搭建(Ubuntu 12.04)及环境导致编译错误QA
- ubuntu 12.04 android编译环境配置
- Android 编译环境配置搭建(Ubuntu 12.04)及环境导致编译错误QA
- Ubuntu 16.04配置Android源码编译环境
- ubuntu 编译android2.2源码配置环境及jdk5(7)
- 天天记录 - Ubuntu 12.04编译并配置Android Windows SDK
- Ubuntu 12.04 64-bit下安装android 2.3.x编译环境指南
- Android系统编译环境搭建—Ubuntu14.04安装&root登录&Chromium root启动&安装配置交叉编译环境
- 环境: ubuntu 12.04 上C / C++, OpenGL, Android, NDK,Ogre环境配置(此贴作废,配置看我新贴)
- Ubuntu 12.04 下编译Android 4.0.3
- 64位Ubuntu编译android的环境配置问题
- Ubuntu 12.04 64-bit下安装android 2.3.x编译环境指南2
- 64位Ubuntu编译android的环境配置问题
- Ubuntu 12.04 配置apue2环境(《unix环境高级编程》源码编译环境安装)
- 配置android source 在ubuntu中编译环境
- Ubuntu系统Android 编译环境配置搭建