File is not of required architecture

Hans Aberg haberg at
Wed Nov 18 23:19:28 CET 2009

On 18 Nov 2009, at 21:17, Jan Gustafsson wrote:

> First, thanks for your tips. I have been trying to
> 	• compile my application as a 64 bit application
> 	• compile GMP in 32 bit mode (using gmp-4.3.1.tar.bz2)
> Both have failed :(. In case 1, ld complained (warning: file is not  
> of required architecture). In case 2. I couldn’t get GMP to compile  
> with 32 bits. I have been playing around with the –arch, m32/64 and  
> ABI options.
> At some point I decided to upgrade the standard Apple gcc (4.0.1) to  
> gcc 4.2, which I installed using MacPorts. The nice thing was that  
> MacPorts also installed gmp 4.3.1. And the libs installed by  
> MacPorts link perfectly with my application.
> So, problem is solved.

On the Apple version of gcc 4.0.1 that is a part of Xcode 3.1.3 for  
Mac OS X 10.5 Leopard, one can only use -arch with i386, ppc and  
ppc64, whereas on gcc 4.2.1 in Xcode for Snow Leopard one can also  
have -arch x86_64. - See links below.


More information about the gmp-bugs mailing list