“ / usr / bin / ld:找不到-lz”

我正在尝试在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 -lz

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

和我的GCC版本输出:


scheung@scheung-virtual-box:/media/EXTDIV/mydroid$ gcc --version

gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

Copyright (C) 2009 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我已经安装了zlib1g-dev库:


$ sudo apt-get install zlib1g-dev 

Reading package lists... Done

Building dependency tree       

Reading state information... Done

zlib1g-dev is already the newest version.


人到中年有点甜
浏览 1938回答 3
3回答

元芳怎么了

我只是遇到了这个问题,并且与公认的解决方案“您的make文件已损坏”和“主机包含绝不应该包含在交叉编译中”相反android构建包含SDK用来构建android应用的许多主机可执行文件。就我而言,make在构建zipalign时停止了,该过程用于在安装到android设备上之前优化apk。安装lib32z1-dev解决了我的问题,您可以在Ubuntu下使用以下命令进行安装:sudo apt-get install lib32z1-dev
打开App,查看更多内容
随时随地看视频慕课网APP