LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2010, 06:38 AM   #1
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Rep: Reputation: Disabled
Question 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.

Last edited by folone; 07-09-2010 at 06:39 AM.
 
Old 07-09-2010, 07:04 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
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
..

Last edited by knudfl; 07-09-2010 at 07:16 AM.
 
1 members found this post helpful.
Old 07-09-2010, 07:23 AM   #3
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
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.
 
Old 07-09-2010, 07:26 AM   #4
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by folone View Post
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!
 
Old 07-09-2010, 07:49 AM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
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.

Last edited by johnsfine; 07-09-2010 at 07:55 AM.
 
Old 07-09-2010, 07:56 AM   #6
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
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.
 
Old 07-09-2010, 08:29 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Quote:
Originally Posted by folone View Post
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.
 
Old 07-09-2010, 08:47 AM   #8
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
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
 
Old 07-09-2010, 08:49 AM   #9
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
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?
 
Old 07-09-2010, 09:04 AM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
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.
 
Old 07-09-2010, 09:12 AM   #11
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
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

Last edited by pr_deltoid; 07-09-2010 at 09:17 AM.
 
Old 07-09-2010, 09:16 AM   #12
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by prdeltoid View Post
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.
 
Old 07-09-2010, 09:18 AM   #13
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
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?

Last edited by pr_deltoid; 07-09-2010 at 09:24 AM.
 
Old 07-09-2010, 09:25 AM   #14
folone
LQ Newbie
 
Registered: Jul 2010
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
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
 
Old 07-09-2010, 09:27 AM   #15
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
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?

Last edited by pr_deltoid; 07-09-2010 at 09:29 AM.
 
  


Reply

Tags
sun java6


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compile problem rania kamal Linux - Software 2 09-28-2008 01:10 PM
Compile Problem! firedude Linux - Software 3 03-14-2007 01:10 PM
Compile problem wmoti Programming 5 11-08-2005 07:23 AM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM
Problem with compile noeffort Linux - Software 2 02-29-2004 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration