Force 32 bit compiling in 64 bit

Asked by Flope

Hi again,
I have a source code of a C program (http://geta.life.uiuc.edu/~gary/programs/DNArates/) and I am trying to compile it in my ubuntu 6.10 (64bit). It is not working. I guess because it is for 32 bits.
I have read that when I am using gcc it is trying to compile for 64 bits.
How can I force to compile in 32 bit? is it possible?
Can I compile the program in other 32 bit machine and I use it in my 64 bits?

Thank you very much for your help!!!!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-defaults Edit question
Assignee:
No assignee Edit question
Solved by:
Flope
Solved:
Last query:
Last reply:
Revision history for this message
Flope (flope004) said :
#1

If I try the following:
gcc -m32 DNArates.c -o DNArates -lm

I get this missage:

In file included from /usr/include/features.h:346,
                 from /usr/include/stdio.h:28,
                 from DNArates.c:55:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
In file included from DNArates.c:57:
DNArates.h:93: warning: conflicting types for built-in function ‘malloc’

I have already installed the following libraries:
 a32-libs (version 1.5ubuntu5)
 lib32stdc++6 (version 4.1.1-13ubuntu5)
 libc6-dev-i386 (version 2.4-1ubuntu12)

Revision history for this message
Best Flope (flope004) said :
#2

The missing library was libc6-dev-i386 (version 2.4-1ubuntu12).