Hi Jim -On Jul 27, 2005, at 2:19 PM, James Housley wrote: From a June 8th question it got SDKROOT_ppc and SDKROOT_i386 entries and that worked for compiling some static libraries. However, when linking the i386 binary against the system frameworks it seems to be getting the frameworks from /System/Library instead of the SDK. I also now suspect that the ppc is getting the frameworks from /System/Library also and not the SDK, but since they both are ppc there isn't the warning about the architecture not matching. I am sure if SDKROOT is defined then the frameworks and libraries are based off of that, but since I need SDKROOT_ppc and SDKROOT_i386 how do I tell Xcode to use the right SDKs? There's not quite enough information here to diagnose your problem.
First of all, in order to use SDKROOT_ppc and SDKROOT_i386 you need to have SDKROOT defined. Otherwise I think Xcode will ignore them and just use the system SDK. So the best method is to set SDKROOT to the main SDK you want to build against, and then SDKROOT_$(arch) for any architectures which need to build against a different SDK. So if you don't have SDKROOT set, then that may explain your problem.
Secondly, which compiler are you building with? Due to limitations of earlier compilers, with GCC 3.3 and earlier there will be a risk of "fall-back-to-the-system-libraries" problems. So it's possible, if you're using GCC 3.3, that that's what you're seeing. (Typically this will manifest itself as some builds succeeding where they should have failed.) GCC 4.0 should not have this problem, however.
Also, it should be pretty obvious in the detailed build log whether or not you are actually building against an SDK. For GCC 3.3 and earlier, Xcode will be passing the NEXT_ROOT environment variable to the compiler and linker, and probably also adding some additional -I flags to paths in the SDK. For GCC 4.0 Xcode will be passing -isysroot to the compiler and -syslibroot to the linker. Inspecting your build log for these points should let you confirm or dispel your suspicions.
Lastly, Xcode 2.1 contains problems building against an SDK and using ZeroLink at the same time (which will be fixed in the next release). So I would recommend in this case not building against an SDK when doing debug builds, and not using ZeroLink when doing release builds (against an SDK). You can set up separate configurations in your targets and/or projects to behave in this way.
If none of this explains the problem, then I would suggest filing a bug and including a fraction of your detailed build log showing where SDKs are not being built against when you expect them to be - some compile lines and a link line, at the least. -- Michael Rawdon Apple Computer, Cupertino CA Xcode Developer email@hidden
|