Link to cross-project source code in Xcode 4

I know that you can have Xcode reference the goals of the framework / static lib assembly in other projects, but if the project you want to access does not have the target framework / static lib environment, can you directly reference the source code from another project Xcode? I tried to do this using both the subproject and the Xcode 4 workspace to no avail. After setting the header search path, all #import statements work correctly, but I still get nasty compiler rewriting characters that are not found.

setenv MACOSX_DEPLOYMENT_TARGET 10.7 /Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/Tony/Library/Developer/Xcode/DerivedData/-bewprsseyzwgmsdpwvjfuzjiilap/Build/Products/Debug -F/Users/Tony/Library/Developer/Xcode/DerivedData/-bewprsseyzwgmsdpwvjfuzjiilap/Build/Products/Debug -filelist /Users/Tony/Library/Developer/Xcode/DerivedData/-bewprsseyzwgmsdpwvjfuzjiilap/Build/Intermediates/.build/Debug/.build/Objects-normal/x86_64/.LinkFileList -mmacosx-version-min=10.7 -fobjc-arc -framework Cocoa -o /Users/Tony/Library/Developer/Xcode/DerivedData/-bewprsseyzwgmsdpwvjfuzjiilap/Build/Products/Debug/.app/Contents/MacOS/ Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MagicalRecordHelpers", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_MRCoreDataAction", referenced from: objc-class-ref in ItemsArrayController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Also, what is associated with this new Xcode 4 workspace? And how exactly does it differ from subprojects? The only thing I could find is that they look visually different ...

Workspace

enter image description here

Sub-projct

enter image description here

+6
source share
1 answer

The answer to the first question seems to be "No Xcode cannot reference source files in another project." To compile the source file (.m files). The Xcode project must contain direct links to them. You can go to setting Target -> Build Phases -> Compiled resources to see what will be compiled. Please note: if the files are not added to the project directly, they will not be displayed within the resources that need to be compiled. However, headers can be transmitted on different projects.

EDIT

And I think the answer to the second question is that although Xcode 3 always requires explicit dependency management, the Xcode 4 workspace allows you to manage target dependencies implicitly if they are all in the same workspace. All that is required to determine the dependency is to add the product of another project that you want to call the linked library on the summary page. These findings took too much time (full time), the documentation on this issue and, of course, should be improved!

+6
source

Source: https://habr.com/ru/post/904971/


All Articles