3

In a Mixed 3.2.5 iOS/MacOS project, there is an existing iOS static library target, and I'm adding a MacOS static library. In the target build settings(all configurations) I

  • set the Base SDK to "Latest Mac OS X"
  • set Architectures to $(NATIVE_ARCH)
  • set Valid Architectures to i386 only
  • use my own PCH file
  • drag headers into Copy Headers, Mac target
  • drag source into Compile Sources, Mac target
  • add the Foundation.framework found at /System/Library/Frameworks/Foundation.framework, set it to the new Mac target

(/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/Foundation.framework is also present, but set to the iOS target static lib)

the target compiles but the product appears NOT in "Debug" but in "Debug-iphonesimulator" instead. I'm assuming this is linking to the iOS Foundation? Whatever it's doing I can't assume that's safe.

changing the order of how I add things seems to have no effect.

any suggestions?

maz
  • 8,056
  • 4
  • 26
  • 25
  • OK I've pretty much come to the conclusion that in a mixed iOS/MacOS static library project you can't depend on Xcode 3.2.5 to generate a binary that is linked to the expected framework. I can't confirm this, but when a MacOS build product appears in a folder named "Debug-iPhonesimulator" it's pretty suspect to me. WORKAROUND: Use XCode 4.0.2 or higher. Xcode 4 consistently links to the correct framework. – maz Jul 15 '11 at 12:08
  • I found a solution to this issue in Xcode 3.2.5. Even though you will see preprocessor macro errors in the static library project, create a new project that depends on it(add the mixed static lib project as a dependency). The dependent project will proceed to compile the dependency without issues(even though the mixed static library project can't compile on its own!). – maz Aug 17 '11 at 15:56

1 Answers1

1

I suggest upgrading to Xcode 4. I have projects that build Mac and iOS libraries and both work as expected.

Randall
  • 14,691
  • 7
  • 40
  • 60