PDA

View Full Version : [SOLVED] [compiling] having a problem with /usr/bin/ld connot find -lz



RainerZA
April 1st, 2012, 05:27 PM
Hi, I am currently trying to build android 4.0.4 for the first time, but i'm having some problem while building c++ files.

when I try to run "make-j4" from Android compiling instructions (http://source.android.com/source/building.html) so I run "make -j1" to check where the error occurs and I get this.


============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=4.0.4.0.4.0.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.0.0-17-generic-x86_64-with-Ubuntu-11.10-oneiric
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
OUT_DIR=out
============================================
host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1


i'm guessing i'm missing some libraries or links for it to miss "/usr/bin/ld: cannot find -lz"

running Ubuntu 11.10 64-bit

Thanks for any help in advance :D

oldos2er
April 1st, 2012, 05:43 PM
Moved to Packaging and Compiling Programs.

idoitprone
April 1st, 2012, 07:45 PM
Hi, I am currently trying to build android 4.0.4 for the first time, but i'm having some problem while building c++ files.

when I try to run "make-j4" from Android compiling instructions (http://source.android.com/source/building.html) so I run "make -j1" to check where the error occurs and I get this.


============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=4.0.4.0.4.0.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.0.0-17-generic-x86_64-with-Ubuntu-11.10-oneiric
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
OUT_DIR=out
============================================
host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
i'm guessing i'm missing some libraries or links for it to miss "/usr/bin/ld: cannot find -lz"

running Ubuntu 11.10 64-bit

Thanks for any help in advance :D



did you follow these directions?
http://source.android.com/source/initializing.htmlchrome://dictionarytip/skin/dtipIconHover.png

SevenMachines
April 1st, 2012, 08:09 PM
Especially note that on amd64 you still require the x86 version of zlib

$ sudo apt-get install zlib1g-dev:i386

RainerZA
April 1st, 2012, 10:07 PM
Especially note that on amd64 you still require the x86 version of zlib

$ sudo apt-get install zlib1g-dev:i386

ah yea that solved it thnx :)