LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 06-04-2009, 11:55 PM   #1
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Rep: Reputation: 15
Question cannot compile 32-bit application on 64-bit ubuntu 9.04


We have been developing a portable 3D game/graphics/simulation application for some time on 32-bit ubuntu 8.04 LTS. Finally we are ready to create versions that take advantage of the extra CPU/SIMD registers, instructions and efficiencies available only in 64-bit mode executables.

So we installed 64-bit ubuntu 9.04 on our computers with the intention to continue development on both 32-bit and 64-bit versions of our applications. We installed the ia32 libs via the synaptic package manager application, but compilation fails with the following error message:

ld cannot find -lstdc++

I assume this means the 32-bit version of the stdc++ library is not installed, or is not installed in the expected location. But I don't know what to do about it. I do not find an obvious solution. I'm guessing the 64-bt stdc++ library was installed when we installed the "build-essential" package. But I don't see any "build-essential32" or equivalent, nor "libc++32" or equivalent listed in the package manager application.

How do we configure our computers to create both 32-bit and 64-bit executables?

PS: The IDE appears to successfully compile all our C and ASM source-code files before it fails this link step (I presume). For some odd reason the IDE stops trying to build after this initial link error, so other errors might be waiting to happen after this one is solved.

-----

The following is basic information about our development tools and application, in case this information matters.

##### IDE and tools
64-bit implementation of CodeBlocks offered by synaptics application
same project settings that worked in 32-bit ubuntu 8.04, except add -m32 option
default paths: /usr/include/GL and /usr/include/X11
link libraries: rt, GL, X11

##### our application
C and ASM source-code compiles/assembles/links/executes in 32-bit ubuntu 8.04
depends upon "C standard libraries", xlib (part of X11, GL (OpenGL), and GLX.
 
Old 06-05-2009, 02:31 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Perhaps you don't have the GlibC development headers, they are in the libc6-dev package.
 
Old 06-05-2009, 03:36 AM   #3
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Original Poster
Rep: Reputation: 15
The following were already selected according to the synaptic GPU package manager:

libc6 - 2.9-4ubuntu6
libc6-dev - 2.9-4ubuntu6
libc6-dbg - 2.9-4ubuntu6
libc6-i386 - 2.9-4ubuntu6
libc6-dev-i386 - 2.9-4ubuntu6

To me, that seems sufficient, though synaptic does not show a file named "libc6-dbg-i386" at all.

Any other ideas?

Last edited by maxreason; 06-05-2009 at 05:49 AM.
 
Old 06-05-2009, 04:51 PM   #4
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Original Poster
Rep: Reputation: 15
more information

cd /usr/lib32
ls -la libst*

outputs

Code:
lrwxrwxrwx 1 root root     18  2009-06-04 19:41 libstdc++.so.5 -> libstdc++.so.5.0.7
-rw-r--r-- 1 root root 737192  2008-05-09 23:18 libstdc++.so.5.0.7
lrwxrwxrwx 1 root root     19  2009-06-04 19:41 libstdc++.so.6 -> libstdc++.so.6.0.10
-rw-r--r-- 1 root root 950424  2009-03-16 18:03 libstdc++.so.6.0.10
To me, that indicates the "stdc++" library is installed in the correct path. I assume "stdc++" and "libstdc++" refer to the same package, right?

I'm at a loss. This is one of those problems that will probably appear obvious --- in retrospect. Unfortunately, I'm not there yet.

PS: I don't explicitly include library libstdc++, but my source-code files do include some C standard libraries. I assume including this library is default behavior for the build tools. Correct?
 
Old 06-06-2009, 07:09 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,030
Blog Entries: 52

Rep: Reputation: Disabled
I'm not on my 64 bit 9.04 at the moment, so I can't check, but I think you need the ia32 libs (look in Synaptic).

Edit (better late than never):
I really must read posts properly. Missed the fact that you've got already got the ia32 libs.

Last edited by brianL; 06-06-2009 at 01:17 PM.
 
Old 06-06-2009, 10:28 PM   #6
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit ubuntu 12.04 LTS
Posts: 205

Original Poster
Rep: Reputation: 15
resolved

Someone in the OpenGL forum figured out my problem... pretty obvious in retrospect.

cd /usr/lib32
ln -s libstdc++.so.6 libstdc++.so

This creates a symbolic link named "libstdc++.so" that refers to "libstdc++.so.6" (the most recent version I have installed). That makes sense to me. Presumably the CodeBlocks IDE (and/or gcc compiler tools) automatically links to "libstdc++.so" with the assumption that will be linked to the most recent installed version of that library. Presumably most applications prefer to link to the newest library, unless they have some unusual need to link to an older version.

I'm guessing the programmer who made the package that contains libstdc++.so forgot to include the symbolic link. I notice this symbolic link is also missing from the /usr/lib64 directory! I guess I better add one into that directory too, before I forget!

Thanks for the ideas, everyone.
 
  


Reply


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
64 bit cpu-64 bit Ubuntu-are there 32 bit app issues? sofasurfer Ubuntu 7 04-09-2014 02:02 PM
32 bit Application on 64 bit Linux OS -- Memory Usage saleem_ak Linux - Newbie 3 04-01-2009 02:59 PM
compiling 32 bit application on 64 bit linux(x86_64) uttam_h Linux - Software 16 07-19-2008 02:33 PM
porting of 32 bit application on 64 bit linux architecture vikaschoudhry1985 Linux - Newbie 2 07-13-2008 10:39 PM
64-bit or 32-bit Application on 64-bit Linux jjana123 Linux - General 4 05-06-2008 05:27 PM


All times are GMT -5. The time now is 10:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration