当前位置:操作系统 > 安卓/Android >>

android 4.0编译错误

1、
************************************************************
You are attempting to build with the incorrect version
of java.
 
Your version is: java version "1.6.0_24".
The correct version is: Java SE 1.6.
 
Please follow the machine setup instructions at
    http://source.android.com/source/download.html
************************************************************
解决方法:
安装java 1.6
在envsetup.sh
最后加入设置环境变量export JAVA_HOME=/usr/local/arm/jdk1.6.0_31

2.
错误2
(ir_dereference_variable*)’ [-Woverloaded-virtual]
external/mesa3d/src/glsl/linker.cpp: In function ‘void
assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’:
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1394:50: error: ‘varyings’ was not
declared in this scope
external/mesa3d/src/glsl/linker.cpp:1394:58: error: ‘offsetof’ was not
declared in this scope
external/mesa3d/src/glsl/linker.cpp:1395:48: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:47: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1412:48: error: ‘position’ was not
declared in this scope
external/mesa3d/src/glsl/linker.cpp:1414:47: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1414:48: error: ‘pointSize’ was
not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1424:47: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1424:48: error: ‘position’ was not
declared in this scope
external/mesa3d/src/glsl/linker.cpp:1428:47: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1428:48: error:
‘frontFacingPointCoord’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1431:47: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1431:48: error:
‘frontFacingPointCoord’ was not declared in this scope
external/mesa3d/src/glsl/linker.cpp: In function ‘void
link_shaders(const gl_context*, gl_shader_program*)’:
external/mesa3d/src/glsl/linker.cpp:1734:49: error: expected primary-
expression before ‘,’ token
external/mesa3d/src/glsl/linker.cpp:1734:50: error: ‘fragColor’ was
not declared in this scope
external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not
declared in this scope
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/
libMesa_intermediates/src/glsl/linker.o] Error 1

解决方法:
把 "#include <stddef.h>" 添加到 linker.cpp 文件头部。

3.
external/oprofile/libpp/format_output.h:94:22: error: reference a€?countsa€? cannot be declared a€?mutablea€? [-fpermissive]
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:
external/oprofile/libpp/format_output.h:94:22: error: reference a€?countsa€? cannot be declared a€?mutablea€? [-fpermissive]
In file included from external/oprofile/libpp/format_output.cpp:26:0:
external/oprofile/libpp/format_output.h:94:22: error: reference a€?countsa€? cannot be declared a€?mutablea€? [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/op_header.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from external/oprofile/libpp/xml_utils.h:15:0,
                 from external/oprofile/libpp/xml_utils.cpp:14:
external/oprofile/libpp/format_output.h:94:22: error: reference a€?countsa€? cannot be declared a€?mutablea€? [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/xml_utils.o] Error 1
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/format_output.o] Error 1
解决方法:
需要修改external/oprofile/libpp/format_output.h:94行
mutable counts_t & counts为
counts_t & counts

 4.
 frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable a€?ParamNamea€? set but not used [-Werror=unused-but-set-variable
 解决方法:
 
 Fix/Workaround:
frameworks/compile/slang/Android.mk
-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
5.
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: a€?ptrdiff_ta€? does not name a typ
解决方法:
$vi external/gtest/src/../include/gtest/internal/gtest-param-util.h
+#include <cstddef>


摘自 坚持到底的Embedded Zone
补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,