我正在尝试在Ubuntu 10.04下编译Android源代码。我收到一个错误消息,/ usr / bin / ld:找不到-lz你能告诉我如何解决吗?什么cannot find -lz意思 这是完整的错误消息:external/qemu/Makefile.android:1101: warning: overriding commands for target `external/qemu/android/avd/hw-config-defs.h'external/qemu/Makefile.android:933: warning: ignoring old commands for target `external/qemu/android/avd/hw-config-defs.h'host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz/usr/bin/ld: cannot find -lzcollect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1和我的GCC版本输出:scheung@scheung-virtual-box:/media/EXTDIV/mydroid$ gcc --versiongcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3Copyright (C) 2009 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.我已经安装了zlib1g-dev库:$ sudo apt-get install zlib1g-dev Reading package lists... DoneBuilding dependency tree Reading state information... Donezlib1g-dev is already the newest version.
3 回答
元芳怎么了
TA贡献1798条经验 获得超7个赞
我只是遇到了这个问题,并且与公认的解决方案“您的make文件已损坏”和“主机包含绝不应该包含在交叉编译中”相反
android构建包含SDK用来构建android应用的许多主机可执行文件。就我而言,make在构建zipalign时停止了,该过程用于在安装到android设备上之前优化apk。
安装lib32z1-dev解决了我的问题,您可以在Ubuntu下使用以下命令进行安装:
sudo apt-get install lib32z1-dev
- 3 回答
- 0 关注
- 1924 浏览
添加回答
举报
0/150
提交
取消