我试图在 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.
(我从this link。)
我有完全相同的错误,和你一样,安装 zlib1g-dev 没有修复它。安装 lib32z1-dev 让我过去了。我有一个 64 位系统,似乎它想要 32 位库。
对于 x64,请安装zlib1g-dev
。
sudo apt-get install zlib1g-dev
我不需要所有的 x86 库;)
ubuntu 中的sudo apt-get install libz-dev
。
我刚刚遇到这个问题,与“你的 make 文件被”和“主机包含不应该包含在交叉编译中”的公认解决方案相反
android 构建包括 SDK 用于构建 android 应用程序的许多主机可执行文件。在我的情况下,make 在构建 zipalign 时停止,用于在 android 设备上安装之前优化 apk。
安装 lib32z1-dev 解决了我的问题,在 Ubuntu 下,您可以使用以下命令安装它:
sudo apt-get install lib32z1-dev
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(61条)