It sounds like you are trying to compile something into a binary of a specific architecture, it, a 32bit binary, or a 64bit binary. Is that what you are trying to do?
If so, you need to have the libraries and header files installed *for that architecture*. So if your system is 64bit and you are trying to compile something for 32xit, then you need the libs and headers for 32bit; just because you have the 64bit versions on your system does not mean the 32bit versions are also there. So you probably need to install those.
After that, it's a simple(-ish) matter of gcc usage. For example:
Code:
gcc -m32 infile.c -o outfile -L/usr/lib -march=i586
More details about what your system is, and what your target is, and what you have tried so far would be helpful.