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

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *