Compiling a C program with a specific architecture
Posted
by Marplesoft
on Stack Overflow
See other posts from Stack Overflow
or by Marplesoft
Published on 2010-03-13T00:37:16Z
Indexed on
2010/03/13
0:57 UTC
Read the original article
Hit count: 366
I was recently fighting some problems trying to compile an open source library on my Mac that depended on another library and got some errors about incompatible library architectures. Can somebody explain the concept behind compiling a C program for a specific architecture? I have seen the -arch
compiler flag before and have seen values passed to it such as ppc
, i386
and x86_64
which I assume maps to the CPU "language", but my understanding stops there. If one program uses a particular architecture, do all libraries that it loads need to be on the same architecture as well? How can I tell what architecture a given program/process is running under?
© Stack Overflow or respective owner