问题
What is Mach-O type in Build Setting in Xcode? and what should it be Set on?
it has these options "Executable" "Dynamic Library" "Bundle" "Static Library" "Relocatable Object File"
I had an error "Apple Mach-O Linker Error Group" since I changed it from Executable to Static Library my error went off, I wanna know is that ok that I changed it? and what all those options mean so I won't face another error in the future.
回答1:
For more detail Building Mach-O Files and Xcode Build Setting Reference
回答2:
To setup Mach-O Type [Mach-O format] determines a linker behaviour
Framework target -> Build Settings -> Mach-O Type
- Executable- Is not linked. Is used to create a launcheble program -- Application.- Application targetis a default setting
- Bundle-- loadable bundle- run time linked. iOS now supports only- Testing Bundle targetwhere it is a default setting to generate a- Loadable bundle.- System->- Testing Bundle->- tested binary. A location of- Testing Bundlewill be depended on target, static or dynamic binary...
- Dynamic Library- Load/run time linked.- Framework target-- Dynamic Libraryis a default setting to generate a- Dynamic framework
 
- Static Library- Compilation time(build time) linked.- Static Library target-- Static Libraryis a default setting to generate a- Static library
- Framework target-- Static Libraryto generate a- Static framework
 
- Relocatable Object File- Compilation time(build time) linked. It is a kind of- Static Libraryextension. All- .ofiles will be relinked at build time and a new single object file will be generated. For example it can be used for- Symbols hidden by default. It is simple to check using- otool[About] command
//Relocatable Object File
otool -L "libRelocatable.a"
Archive : /libRelocatable.a
/libRelocatable.a(relocatable_object_file.o):
/libRelocatable.a(MyClass.o):
//Static library
otool -L "/libStatic.a"
/libStatic.a:
[Vocabulary]
[Framework static vs dynamic]
来源:https://stackoverflow.com/questions/45300314/what-is-mach-o-type-should-i-use-it-in-my-ios-objective-c-project