我想在Ubuntu 10.04下編譯Android源代碼。我得到一個錯誤的說法,「/ usr/bin/ld:找不到-lz」
在/ usr /斌/勞工處:找不到-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版本輸出:
[email protected]:/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)
它在Kubuntu 12.04 x64上與libz-dev(用於zlib1g-dev的虛擬軟件包)一起工作。 – Qsiris 2013-01-22 16:06:59
幫助我解決了完全不同的問題。謝謝:-) – mgjk 2013-12-25 16:20:24
這應該是被接受的答案 – Speccy 2014-03-23 19:45:22