trying to build a 32bit binary on my 64bit system but it wont compile for me

Started by
8 comments, last by helpmenow 13 years, 2 months ago
im trying to build a 32bit binary on my 64bit system but it wont compile for me.

my comps specs.
OS: ubuntu linux 64bit
Processor: AMD Dual Core x64

Library Dependencies
OpenGL
SDL

i did sudo apt-get install ia32-libs through terminal. so im thinking the libraries are here.

im using code::blocks i created a new build and called it "Release32". added -m32 and `sdl-config --cflags` to project->build_options->compiler_settings->other_options. added `sdl-config --libs` to project->build_options->linker_settings->other_linker_options.everything seems to compile fine. but then it gives me this error

ld cannot find -lSDL

any ways im trying to do this because i want to run this app on a 32bit computer with ubuntu on it.

by the way both of my other builds "debug" and "release" compile and run fine.
Advertisement
EDIT: Are you sure sdl-config is giving you the location of the 32-bit libs? I don't see why it would.
it seems to work fine on my 64bit builds. so would you know how/where i could tell code::blocks the location of the libraries? i mean what is that error trying to say that it cant find the 32bit version of the libraries?

also im not telling code:blocks where the location of the libraries is. but that doesn't seem to effect my 64bit builds.
Quote:Original post by helpmenow
also im not telling code:blocks where the location of the libraries is.

Of course you are. You may not be aware of it, though. Do you know what the significance of backquotes is in UNIX shell scripting? Do you know what sdl-config does?
sorry i haven't been back in a while. anyways Sneftel i don't know the significance of backquotes in linux. i don't mean to sound sarcastic but what is the significance to backquotes. i figured sdl-config just configured the compiler for me. obviously it does something. i just don't know exactly what its doing.
oh and by the way the new site is AWESOME!
still having an issue with this. if anyone has any ideas please let me know.
does anybody have an idea on how to build a 32 bit binary on a 64 bit system.

COMPILER ERROR:

ld cannot find -lSDL

what do i need to change to fix this error?
Sorry, this totally flew under my radar. Hope you're still reading. The significance of backquotes is explained here. Try running that command yourself (sdl-config --libs) and see what it outputs. Remember, sdl-config is either going to report the 32-bit configuration, or the 64-bit configuration; it can't do 'whichever one's the right one'. The --exec-prefix option for sdl-config may help, but you may want to just hardcode in the paths rather than using sdl-config at all.
thanks for the reply. as far as the backquotes i read up on that that after you said i should. and for the sdlconfig personally i would rather hardcode the paths its just that on Linux with code blocks ive never had to do it before im only use to msvc++. i know Linux stores libraries under lib32 and lib64. but in MSVC++ all i had to do was put the directory in and the compiler found the library for me. theres like four different ".so" files with sdl in the lib32 folder. anyways thanks for the response.

This topic is closed to new replies.

Advertisement