Android 4.04编译错误及更改方法整理

1.external/clearsilver/cgi/cgi.c:22:18: 致命错误: zlib.h:没有那个文件或目录

编译中断。

解决方法:sudo apt-get install zlib1g-dev


2.

prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55:22: 致命错误: X11/Xlib.h:没有那个文件或目录

解决方法:sudo apt-get install libx11-dev


3.host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp

<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]

<built-in>:0:0: 附注: 这是先前定义的位置

cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] 错误 1


解决方法:通过SMBA服务器进入并修改源码目录下/build/core/combo/HOST_linux-x86.mk文件:

将以下语句

HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0

修改为

HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0


4.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’在此作用域中尚未声明


解决这个问题需要修改文件如下:

把 "#include <stddef.h>" 添加到 linker.cpp 文件头部。这样就可以编译完成了。





6.make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] 错误 1

lsy@lsy:~/share/Ex


解决办法:

sudo apt-get install libgl1-mesa-dev


7.frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: 错误: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]

cc1plus: all warnings being treated as errors

解决办法:

$ vim frameworks/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


8.make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/gralloc.goldfish_intermediates/gralloc.o] 错误 1

解决办法:

4/development/tools/emulator/opengl/system/gralloc

gralloc.cpp中struct private_module_t HAL_MODULE_INFO_SYM 结构提中添加

getphys: NULL,


9.make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] 错误 1

解决办法:

vim external/mesa3d/src/glsl/linker.cpp   添加    #include <cstdder>


10.external/oprofile/libpp/format_output.h:94:22: 错误: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]

解决办法:

把:

mutable counts_t & counts;

改为:

counts_t & counts;  //94行


11 make: ***

[out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1


解决办法:


vim external/llvm/llvm-host-build.mk


添加:


LOCAL_LDLIBS := -lpthread  -ldl


12.make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] 错误 1

解决方法:


vim external/gtest/include/gtest/internal/gtest-param-util.h


添加:


#include <cstddef>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值