在ubuntu x86_64 GCC4.6上ics编译错误以及解决办法
2012-10-12 16:28
399 查看
问题1:
<command-line>:0:0:warning:"_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0:note: this is the location of theprevious definition
hostExecutable:mksnapshot(out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/mksnapshot)
true
Install:out/host/linux-x86/bin/mksnapshot
Install:out/host/linux-x86/bin/mkyaffs2image
host C++:obbtool <=frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0:error: "_FORTIFY_SOURCE"redefined [-Werror]
<built-in>:0:0:note: this is the location of theprevious definition
cc1plus:all warnings being treated as errors
make:***[out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1
icscompile fail!
解决办法:参考http://code.google.com/p/android/issues/detail?id=20795
修改build/core/combo/HOST_linux-x86.mk:
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE-D_FORTIFY_SOURCE=0
问题2:
make[1]: Leavingdirectory`ics/device/hisilicon/godbox/driver/sdk/msp/android_driver/RT3090_LinuxSTA_V2.3.1.4_20100222'
之后就报错了。看不出什么原因。重新make试试;
->重新make居然就过去了。
问题3:
external/mesa3d/src/glsl/linker.cpp:1394:49: error:expectedprimary-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:expectedprimary-expression before ',' token
external/mesa3d/src/glsl/linker.cpp:1412:47: error:expectedprimary-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:expectedprimary-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:expectedprimary-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:expectedprimary-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:expectedprimary-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'voidlink_shaders(const gl_context*, gl_shader_program*)':
external/mesa3d/src/glsl/linker.cpp:1734:49: error:expectedprimary-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
解决方法参考http://code.google.com/p/android/issues/detail?id=23206:
Adding a "#include <stddef.h>" tolinker.cppfixes the issue
The full location of the linker.cpp fileis"external/mesa3d/src/glsl/linker.cpp" from with in yourandroidsource directory.
(Problem comes from host libstdc++. Since version4.6<cstdio> does not include <cstddef> anymore.
Downgrade host package to libstdc++ 4.5 or add'#include<cstddef>' into linker.cpp)
问题4:
external/oprofile/libpp/format_output.h:94:22:error:reference 'counts' cannot be declared 'mutable'
解决办法:http://code.google.com/p/android/issues/detail?id=22003
Fix/Work-around:
-mutable counts_t & counts;
+counts_t & counts;
问题5:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11:error:'ptrdiff_t' does not name a type
解决办法:http://code.google.com/p/android/issues/detail?id=22005
external/gtest/include/gtest/internal/gtest-param-util.h
#include<vector>
+#include <cstddef>
#include<gtest/internal/gtest-port.h>
问题6:external/llvm/lib/Support/Mutex.cpp:143:undefinedreference to `pthread_mutex_trylock'
解决方法:http://code.google.com/p/android/issues/detail?id=22011
Add "LOCAL_LDLIBS := -lpthread -ldl"inexternal/llvm/llvm-host-build.mk works for me.
问题7:frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23:error:variable 'ParamName' set but not used
解决办法:
/article/11774435.html
$vimframeworks/compile/slang/Android.mk
将 local_cflags_for_slang 所在行最后的 -Werror 去掉:
#local_cflags_for_slang:=-Wno-sign-promo -Wall -Wno-unused-parameter -Werror
local_cflags_for_slang := -Wno-sign-promo-Wall-Wno-unused-parameter
另外,将gcc版本降低为4.4可以避免ics编译错误:
sudo apt-getinstall gcc-4.4
sudo apt-getinstall g++-4.4
sudo ln -s/usr/bin/gcc-4.4/usr/bin/gcc
sudo ln -s/usr/bin/g++-4.4/usr/bin/g++
<command-line>:0:0:warning:"_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0:note: this is the location of theprevious definition
hostExecutable:mksnapshot(out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/mksnapshot)
true
Install:out/host/linux-x86/bin/mksnapshot
Install:out/host/linux-x86/bin/mkyaffs2image
host C++:obbtool <=frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0:error: "_FORTIFY_SOURCE"redefined [-Werror]
<built-in>:0:0:note: this is the location of theprevious definition
cc1plus:all warnings being treated as errors
make:***[out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1
icscompile fail!
解决办法:参考http://code.google.com/p/android/issues/detail?id=20795
修改build/core/combo/HOST_linux-x86.mk:
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE-D_FORTIFY_SOURCE=0
问题2:
make[1]: Leavingdirectory`ics/device/hisilicon/godbox/driver/sdk/msp/android_driver/RT3090_LinuxSTA_V2.3.1.4_20100222'
之后就报错了。看不出什么原因。重新make试试;
->重新make居然就过去了。
问题3:
external/mesa3d/src/glsl/linker.cpp:1394:49: error:expectedprimary-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:expectedprimary-expression before ',' token
external/mesa3d/src/glsl/linker.cpp:1412:47: error:expectedprimary-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:expectedprimary-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:expectedprimary-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:expectedprimary-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:expectedprimary-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'voidlink_shaders(const gl_context*, gl_shader_program*)':
external/mesa3d/src/glsl/linker.cpp:1734:49: error:expectedprimary-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
解决方法参考http://code.google.com/p/android/issues/detail?id=23206:
Adding a "#include <stddef.h>" tolinker.cppfixes the issue
The full location of the linker.cpp fileis"external/mesa3d/src/glsl/linker.cpp" from with in yourandroidsource directory.
(Problem comes from host libstdc++. Since version4.6<cstdio> does not include <cstddef> anymore.
Downgrade host package to libstdc++ 4.5 or add'#include<cstddef>' into linker.cpp)
问题4:
external/oprofile/libpp/format_output.h:94:22:error:reference 'counts' cannot be declared 'mutable'
解决办法:http://code.google.com/p/android/issues/detail?id=22003
Fix/Work-around:
-mutable counts_t & counts;
+counts_t & counts;
问题5:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11:error:'ptrdiff_t' does not name a type
解决办法:http://code.google.com/p/android/issues/detail?id=22005
external/gtest/include/gtest/internal/gtest-param-util.h
#include<vector>
+#include <cstddef>
#include<gtest/internal/gtest-port.h>
问题6:external/llvm/lib/Support/Mutex.cpp:143:undefinedreference to `pthread_mutex_trylock'
解决方法:http://code.google.com/p/android/issues/detail?id=22011
Add "LOCAL_LDLIBS := -lpthread -ldl"inexternal/llvm/llvm-host-build.mk works for me.
问题7:frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23:error:variable 'ParamName' set but not used
解决办法:
/article/11774435.html
$vimframeworks/compile/slang/Android.mk
将 local_cflags_for_slang 所在行最后的 -Werror 去掉:
#local_cflags_for_slang:=-Wno-sign-promo -Wall -Wno-unused-parameter -Werror
local_cflags_for_slang := -Wno-sign-promo-Wall-Wno-unused-parameter
另外,将gcc版本降低为4.4可以避免ics编译错误:
sudo apt-getinstall gcc-4.4
sudo apt-getinstall g++-4.4
sudo ln -s/usr/bin/gcc-4.4/usr/bin/gcc
sudo ln -s/usr/bin/g++-4.4/usr/bin/g++
相关文章推荐
- 在ubuntu x86_64 GCC4.6上ics编译错误以及解决办法
- 用xcode6.3编译早期工程时出现Undefined symbols for architecture x86_64错误的解决办法(转)
- mac上使用g++编译出错“Undefined symbols for architecture x86_64:” 错误解决办法
- VirtualBox 安装 ubuntu 出现This kernel requires an X86-64 CPU,but only detected an i686 CPU错误的解决办法
- ubuntu源码编译安装php常见错误解决办法
- 编译linux-2.6.32的时候出现的错误以及解决办法
- 如何解决duplicate symbols for architecture x86_64编译错误
- Ubuntu下编译Coin3D时,提示“cc_debugerror_post”错误的解决办法
- ubuntu源码编译安装php常见错误解决办法
- 在ubuntu 14.04 编译android 2.3.1 错误解决办法
- 在Ubuntu 64位环境下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法
- Xcode编译WebApps找不到js的错误解决办法以及Xcode编译错误和警告汇总
- 32位ubuntu编译Gingerbread的一项错误解决办法
- 编译错误“The run destination My Mac 64-bit is not valid for Running the scheme '***',解决办法
- opencv-3.1.0在Ubuntu系统上使用g++编译时出现“/usr/bin/ld: cannot find -lippicv ” 错误及其解决办法
- 一分钟解决Xcode的Undefined symbols for architecture x86_64编译错误
- (转)ubuntu源码编译安装php常见错误解决办法
- 编译错误“The run destination My Mac 64-bit is not valid for Running the scheme '***',解决办法
- 立宇泰标准5.0BSP编译错误以及解决办法
- 在Ubuntu 下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法