About Other linker flags on xcode

Source: Internet
Author: User

TargetsOptions include:Otherlinker flagsTo enterXcodeSuch:-ObjC-all_load-force_loadAnd so on


First, you need to describeOther linker flagsWhat is it. To put it bluntlyLDCommand except the default parameters.LDThe command implements the work of The linker. For details, you can go to the terminalMan LDView.

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. OBJFile, and then a project will inevitably have many. OBJFile, 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.