Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I already asked this question on SO, but it seems like the problem is probably with linker.

So, the question is:

I'm trying to build a project, using $ make, but it fails:

host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/ 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../ 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/ 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/] Error 1

Now look at this library:

$ ls -l /usr/lib/ 
lrwxrwxrwx 1 root root 20 2010-07-07 17:08 /usr/lib/ -> /lib/

$ file /lib/
/lib/ ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

and I have:

$ arch

I installed this library like this:

sudo apt-get install libz-dev

So.. How do I get through this? And how do I make Ubuntu download right libs in the future? And I'm actually not sure: is this the real problem, or it is somewhere else?

I'm also unable to install some required packages:

E: Couldn't find package lib32z1-dev
E: Couldn't find package lib32ncurses5-dev

P.S. Ubuntu 10.04 LTS, running on Lenovo ThinkPad SL500, Core 2 DUO CPU.

share|improve this question

I am having this same issue on my Lenovo Netbook s10e Intel Atom running Ubuntu 10.04 netbook edition. After countless hours of searching the net for answers I hear this has something to Java6 checking and forcing a 64 bit build in Clearsilver for 32bit systems. The solution was to roll back the clearsilver path located here:;a=commitdiff;h=d36910a8110d8377b22301274d2b5131a732a72b

unfortunately i am not sure how exactly to do this. i used the abandon feature in repo to remove those .mk links listed but it did not change the error.

would really appreciate some help.

share|improve this answer
just found some helpful information on this issue here:… – slimatic Jul 10 '10 at 6:05
You found more threads by the OP, actually. But forcing -m64 -> broken build process. – Tobu Jul 10 '10 at 7:52
yeah, that's my question on LQ :) But there's no solution in that thread neither. – folone Jul 10 '10 at 8:42

The Canonical (not "canonical") package names for Lucid Lynx are zlib1g-dev and libncurses5.

Just curious, did you invent the name libz-dev or did some documentation lead you to that?

share|improve this answer
My system cannot find those two. But it can fing libz-dev, so.. – folone Jul 10 '10 at 8:43

Your system seems in order, but the build process could be broken. Does make tell you the command it uses to build?

share|improve this answer
up vote 0 down vote accepted

It seems, that I've resolved this problem. I replaced my jdk6 with sun-jdk5 (added Jaunty's repo) and replaced my default jdk6 with it:

sudo update-java-alternatives --set java-1.5.0-sun

I've left my laptop compiling for the weekend, and now it seems, that it succeeded.

share|improve this answer
Really? this still did not solved my case. – YumYumYum May 10 '14 at 21:00

I am hearing that trying to compile Android on a 32-bit Ubuntu installation may not work. Is this true? Any success on 32-bit installation of Ubuntu 10.0.4 ?

@folone I also replaced the jdk6 with sun-jdk5 but it did not resolve the issue.

share|improve this answer
What is the error message, you are having? some ClearSilver thing, or problems with missing libraries, mentioned in the question? Or something new? Did you do $ sudo update-java-alternatives --set java-1.5.0-sun to actually replace your jdk6 with jdk5? What does $ java -version tell you? – folone Jul 13 '10 at 9:37
Also, I just wrote a blog post on problems, I encountered during the build and debug process. Here:… Hope, it helps. – folone Jul 13 '10 at 10:29
i was getting errors like this again: /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../ when searching for -lz i finally got a successful build (even though i am stuck on boot loop). the issue was with some 64amd libs that were installed as well when i run this: sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline5-dev gcc-multilib g++-multilib libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline5-dev libz-dev – slimatic Jul 13 '10 at 16:43
after installing the packages i went back and removed all packages that had 64 or amd or both in them. and guess what? that worked. once i have successfully flashed the boot.img system.img and recovery.img i will post my results. i used this as a guide - it was helpful: – slimatic Jul 13 '10 at 16:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.