• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
how to link to separate libs for i386 (10.4) and PPC (10.3.9) link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to link to separate libs for i386 (10.4) and PPC (10.3.9) link


  • Subject: how to link to separate libs for i386 (10.4) and PPC (10.3.9) link
  • From: Rua Haszard Morris <email@hidden>
  • Date: Wed, 17 May 2006 11:38:04 +1200

I'm having problems linking a universal binary targeting 10.3.9 for ppc and 10.4 for i386. The problem appears to be that the linker is not being told where to look for the appropriate i386-specific libs:

/usr/bin/ld: warning /System/Library/Frameworks/Carbon.framework/ Carbon cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
/usr/bin/ld: warning fat file: /usr/lib/gcc/i686-apple-darwin8/4.0.1/ libstdc++.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
/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: warning fat file: /usr/lib/libSystem.B.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
/usr/bin/ld: Undefined symbols:
_DisposeDialog
<etc>


What worries me slightly is that I would expect the linker should be looking in the target SDK for all these libs; it appears to be using frameworks from /System and libs from /usr which are all PPC (because my machine is a G4). Shouldn't all the frameworks and libs come out of the appropriate sdk?

How do I set up Xcode to link to the correct libs - is it a matter of more correctly prodding the linker with (perhaps) $LDFLAGS? Or is there a more simple "correct" way of setting up the project?

I have tried specifying SDK-specific paths for frameworks and libs as follows (via an xcconfig file):

FRAMEWORK_SEARCH_PATHS_ppc $(SDKROOT_ppc)/System/Library/Frameworks
FRAMEWORK_SEARCH_PATHS_i386 $(SDKROOT_i386)/System/Library/Frameworks
LIBRARY_SEARCH_PATHS_ppc $(LIBRARY_SEARCH_PATHS) $(SDKROOT_ppc)/usr/lib
LIBRARY_SEARCH_PATHS_i386 $(LIBRARY_SEARCH_PATHS) $(SDKROOT_i386)/usr/ lib


but this doesn't seem to be the best approach.

Any tips from people who've got this kind of thing working would be appreciated.

Thanks,
Rua HM.
_______________________________________________
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


  • Follow-Ups:
    • Re: how to link to separate libs for i386 (10.4) and PPC (10.3.9) link
      • From: Rua Haszard Morris <email@hidden>
  • Prev by Date: Re: Viewing and Editing Anonymous Namespace Variables
  • Next by Date: claim a document type but not its icon
  • Previous by thread: Re: Viewing and Editing Anonymous Namespace Variables
  • Next by thread: Re: how to link to separate libs for i386 (10.4) and PPC (10.3.9) link
  • Index(es):
    • Date
    • Thread