TargetsOptions include:Otherlinker flagsTo enterXcodeSuch:-ObjC-all_load-force_loadAnd so on
First, you need to describeOther linker flags
What is it. To put it bluntlyLD
Command except the default parameters.LD
The command implements the work of The linker. For details, you can go to the terminalMan LD
View.
If someone doesn't know what the linker is, I can give a simple description.
The following steps are required for a program from easy-to-read code to executable files:
Source code> Preprocessor> compiler> assembler> machine code> linker> Executable File
After the source file is processed in a series, the corresponding. OBJ
File, and then a project will inevitably have many. OBJ
File, and there are various relationships between these files, such as function calls. The linker links these target files with the libraries used to form a complete executable file.
The following describes 3 common parameters:
- objc : after this parameter is added, the linker loads all Objective-C classes and categories in the static library to the end.
- all_load : the linker will send all the target files But do not use this parameter! If you use more than one static library file and then use this parameter, you may encounter ld: duplicate symbol error because the same target file may exist in different library files, therefore, we recommend that you use -objc = "">-force_load parameter.
-force_load : what you do is the same as -all_load , however, -force_load you must specify the path of the library file to be fully loaded. In this case, you just fully load a library file without affecting the On-Demand Loading of other library files