Re: failed to compile for universal binary?
Re: failed to compile for universal binary?
- Subject: Re: failed to compile for universal binary?
- From: Chris Espinosa <email@hidden>
- Date: Sat, 17 Dec 2005 22:01:42 -0800
On Dec 17, 2005, at 9:09 PM,
~{P;8Y~} wrote:
emac08deemac:~~/Desktop emac08$ gcc -arch ppc -arch i386 main.c -o bo
/usr/bin/ld: for architecture i386
/usr/bin/ld: warning fat file: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
/usr/bin/ld: Undefined symbols:
___keymgr_dwarf2_register_sections
__cthread_init_routine
_atexit
_errno
_exit
_mach_init_routine
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccaypHyL.out (No such file or directory)
My OS version is 10.4.1. But I compiled it on the intel-based mac successfully,I don't know why?
Intel-based Mac OS is installed Universal, that is, the libraries in /usr/lib have both PPC and Intel sides.
In a stock 10.4.x system on PPC, you only have PPC code installed in /usr/lib, so linking compiled Intel code will fail.
That's why you should pass -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ to the compiler when building universal. The Universal SDK contains universal stub libraries so linking works regardless of what system you build on.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden