LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compile problem (https://www.linuxquestions.org/questions/linux-newbie-8/compile-problem-818890/)

folone 07-09-2010 06:38 AM

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

Code:

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

Now look at this library:

Code:

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

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

and I have:

Code:

$ arch
i686

I installed this library like this:

Code:

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:

Code:

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.

knudfl 07-09-2010 07:04 AM

Welcome to LQ. .. .. :)

""cannot find -lz""
You are not supposed to guess package names.
sudo apt-cache search zlib

sudo apt-get install zlib1g-dev libncurses5-dev
..

Good luck !
..
P.S. : Are you quite sure, the OS is i386. And not x86_64 ?
( " amd64 " ).
http://packages.ubuntu.com/lucid/zlib1g-dev
http://packages.ubuntu.com/lucid/libncurses5-dev
..

folone 07-09-2010 07:23 AM

Quote:

Originally Posted by knudfl (Post 4028222)
Welcome to LQ. .. .. :)

""cannot find -lz""
You are not supposed to guess package names.
sudo apt-cache search zlib

sudo apt-get install zlib1g-dev libncurses5-dev
..

Good luck !
..
P.S. : Are you quite sure, the OS is i386. And not x86_64 ?
( " amd64 " ).
http://packages.ubuntu.com/lucid/zlib1g-dev
http://packages.ubuntu.com/lucid/libncurses5-dev
..

Thank you :)
It says, I already have those packages installed. As for OS, I run arch, and it says i686. And it still does not compile.

folone 07-09-2010 07:26 AM

Quote:

Originally Posted by folone (Post 4028234)
Thank you :)
It says, I already have those packages installed. As for OS, I run arch, and it says i686. And it still does not compile.

Wait a second, everything started working after I did
Code:

sudo apt-get install lib64z1-dev
So.. does this actually mean, that I have a 64bit machine? Or 64bit OS?
P.S. Thanks a lot!

johnsfine 07-09-2010 07:49 AM

GCC can be compiled to run on x86 but be able to compile for either x86 or x86_64 (selected by command line switch).

The output of the arch command is a very strong indication that you are running i686.

A few of the other things you said are indirect indications that you are building this package x86_64. There may be something in its makefile that causes it to build x86_64 and you may have gcc and other tools set up to support building x86_64 on an i686 system. You haven't given direct enough evidence for all that to be more than just a guess.

But regardless of what you can build, you can't run x86_64 on an i686 OS.

Are you able to run what you just succeeded in building? If so, did the makefile build more than one version (build both x86 and x86_64)?

Edit, I reached this link indirectly from the one you posted:
http://source.android.com/source/download.html
That clearly states the build should be 32 bit on either 32 bit or 64 bit Linux. That makes it unlikely it is somehow deciding to build 64 bit on 32 bit Linux.

So I don't know what to make of the indirect evidence you've given that looks like a 64 bit build on 32 bit Linux. More likely there is some totally different explanation.

folone 07-09-2010 07:56 AM

Quote:

Originally Posted by johnsfine (Post 4028262)
GCC can be compiled to run on x86 but be able to compile for either x86 or x86_64 (selected by command line switch).

The output of the arch command is a very strong indication that you are running i686.

A few of the other things you said are indirect indications that you are building this package x86_64. There may be something in its makefile that causes it to build x86_64 and you may have gcc and other tools set up to support building x86_64 on an i686 system. You haven't given direct enough evidence for all that to be more than just a guess.

But regardless of what you can build, you can't run x86_64 on an i686 OS.

Are you able to run what you just succeeded in building? If so, did the makefile build more than one version (build both x86 and x86_64)?

I haven't built it yet, there's another problem now.

johnsfine 07-09-2010 08:29 AM

Quote:

Originally Posted by folone (Post 4028269)
I haven't built it yet, there's another problem now.

1) When replying with a quote, please cut that quote down to just the relevant parts. Don't quote all of a long previous post.

2) I had already replied to your other thread as well. I didn't pay attention to your name, so I didn't realize I was replying to the same person.

That further confirms you have a 32 bit build of Ubuntu.

folone 07-09-2010 08:47 AM

Quote:

Originally Posted by johnsfine (Post 4028298)
1) When replying with a quote, please cut that quote down to just the relevant parts. Don't quote all of a long previous post.

Ok, sorry, I'm new here :)

folone 07-09-2010 08:49 AM

Quote:

Originally Posted by johnsfine (Post 4028298)
That further confirms you have a 32 bit build of Ubuntu.

So should I start from the very beginning with building platform, because even if I succeed, the platform, that uses 64-bit libs won't even run?

johnsfine 07-09-2010 09:04 AM

That link gives instructions for preparing 32 bit Ubuntu. One very important step was
Code:

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
Did you do that step? That seems to install the required version of the JDK, but in your other thread you're trying to install the JDK by a less appropriate method.

I didn't see anything on the Android web site that says it should be using 64 bit libs on Ubuntu.

pr_deltoid 07-09-2010 09:12 AM

I'm going to double-post this:
What are you trying to make? You were just told to use a 32-bit JDK, not a 64-bit JDK.
Which version of Ubuntu are you using? If you just want to install the JDK, either run
Code:

sudo apt-get install sun-java6-jdk
or enable the partner repositories from System->Administration->Software Sources and then run
Code:

sudo apt-get install sun-java6-jdk
(if you're using the newest Ubuntu.)


For the jre and browser plugin:
Code:

sudo apt-get install sun-java6-jre sun-java6-plugin

folone 07-09-2010 09:16 AM

Quote:

Originally Posted by prdeltoid (Post 4028351)
I'm going to double-post this:
What are you trying to make? You were just told to use a 32-bit JDK, not a 64-bit JDK.
Which version of Ubuntu are you using? If you just want to install the JDK, either run
Code:

sudo apt-get install sun-java6-jdk
or enable the partner repositories from System->Administration->Software Sources and then run
Code:

sudo apt-get install sun-java6-jdk
if you're using the newest Ubuntu.

I did that, but the error (this one) remains.

pr_deltoid 07-09-2010 09:18 AM

Using apt-get will not give you a make error. You're not installing from source. That one still remains? I asked you what that one is even about. If you're not compiling something, you would not get a make error. What are you compiling? What caused the make error in your other thread?

folone 07-09-2010 09:25 AM

Quote:

Originally Posted by johnsfine (Post 4028348)
That link gives instructions for preparing 32 bit Ubuntu. One very important step was
Code:

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
Did you do that step? That seems to install the required version of the JDK, but in your other thread you're trying to install the JDK by a less appropriate method.

I didn't see anything on the Android web site that says it should be using 64 bit libs on Ubuntu.

I did, but
Code:

E: Couldn't find package sun-java5-jdk

pr_deltoid 07-09-2010 09:27 AM

What version of Ubuntu are you using? Where did you come up with the idea of installing the Java 5 SDK? What does Android have to do with installing Java on Ubuntu? Did you enable the partner repositories from System->Administration->Software Sources?


All times are GMT -5. The time now is 01:00 PM.