iOS SDK 开发之 Other linker flags

简单来说 Xcode 中 Other linker flags 配置是链接器 ld 命令中除了默认参数外的其他参数信息,链接器 ld 是把若干库和文件整合起来生成一个文件。

MAC 终端执行 man ld 命令查看详细文档

The ld command combines several object files and libraries, resolves references, and produces an ouput file. ld can produce a final linked image (executable, dylib, or bundle), or with the -r option, produce another object file. If the -o option is not used, the output file produced is named “a.out”.
ld命令组合了多个目标文件和库,解析了引用,并生成了一个输出文件。 ld可以生成最终的链接图像(可执行文件,dylib或bundle),或者使用-r选项生成另一个目标文件。如果未使用-o选项,则生成的输出文件名为“a.out”。

一些选项配置参数

-lx
This option tells the linker to search for libx.dylib or libx.a in the library search path. If string x is of the form y.o, then that file is searched for in the same places, but without prepending ‘lib’ or appending ‘.a’ or ‘.dylib’ to the filename.
此选项告诉链接器在库搜索路径中搜索libx.dylib或libx.a。 如果字符串x的格式为y.o,则在相同的位置搜索该文件,但不要在文件名之前添加“lib”或附加“.a”或“.dylib”。

-framework name[,suffix]
This option tells the linker to search for ‘name.framework/name’ the framework search path. If the optional suffix is specified the framework is first searched for the name with the suffix and then without (e.g. look for ‘name.framework/name_suffix’ first, if not there try ‘name.framework/name’).
此选项告诉链接器搜索框架搜索路径的“name.framework / name”。 如果指定了可选后缀,则首先在框架中搜索带有后缀的名称然后不使用(例如,首先查找’name.framework / name_suffix’,如果没有,请尝试`name.framework / name’)。

-ObjC
Loads all members of static archive libraries that implement an Objective-C class or category.
加载静态归档库中所有 Objective-C 类和分类

-all_load
Loads all members of static archive libraries.
加载静态归档库中所有成员

-force_load path_to_archive
Loads all members of the specified static archive library.
Note: -all_load forces all members of all archives to be loaded. This option allows you to target a specific archive.
加载指定静态归档库的所有成员。
注意:-all_load强制加载所有归档的所有成员。 此选项允许您定位特定存档。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值