Xcode Other Link Flag 参数含义

探讨背景:

最近编译xcode的工程,pod install之后,总是经常提示某个库找不到什么的,导致工程无法编译起来,但是看路径和工程下目录都是在的,所以猜测是不是xcode的缓存相关的问题,因为有时候是拉取了新的代码或者变动了Podfile,

image.png

解决这种明明在,却编译不过的问题,我自己发现可以通过Build Setting选项里面的Other Link Flag选项将找不到的库移除,然后本地目录也移除,然后重新pod install即可解决这个问题.

Other Link Flag参数
image.png

但是打开工程配置的一些参数的时候,发现里面对frameWork的引用方法不同,详情可以看上面的参数,有的frameWork前面带着-l, 有的就是-framework,还有-Objc,这分别代表什么区别呢吗,一直没有注意过,-objc和all_load大家可能了解的比较多,但是这几个参数的区别是什么呢,经过请教技术群的一些朋友,发现是代表的系统底层的一个命令对应的函数

终端执行 man ld即可看到对应的含义及介绍

General Commands Manual                       ld(1)

NAME
     ld – linker

SYNOPSIS
     ld files...  [options] [-o outputfile]

DESCRIPTION
     The ld command combines several object files and libraries, resolves
     references, and produces an output 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".

   Universal
     The linker accepts universal (multiple-architecture) input files, but
     always creates a "thin" (single-architecture), standard Mach-O output file.
     The architecture for the output file is specified using the -arch option.
     If this option is not used, ld attempts to determine the output
     architecture by examining the object files in command line order.  The
     first "thin" architecture determines that of the output file.  If no input
     object file is a "thin" file, the native 32-bit architecture for the host
     is used.
     The architecture for the output file is specified using the -arch option.
     If this option is not used, ld attempts to determine the output
     architecture by examining the object files in command line order.  The
     first "thin" architecture determines that of the output file.  If no input
     object file is a "thin" file, the native 32-bit architecture for the host
     is used.

     Usually, ld is not used directly.  Instead the compiler driver invokes ld.
     The compiler driver can be passed multiple -arch options and it will create
     a universal final linked image by invoking ld multiple times and then
     running lipo(1) merge the outputs into a universal file.

   Layout
     The object files are loaded in the order in which they are specified on the
     command line.  The segments and the sections in those segments will appear
     in the output file in the order they are encountered in the object files
     being linked.  All zero fill sections will appear after all non-zero fill
     sections in their segments.

   Libraries
     A static library (aka static archive) is a collection of .o files with a
     table of contents that lists the global symbols in the .o files.  ld will
     only pull .o files out of a static library if needed to resolve some symbol
     reference.  Unlike traditional linkers, ld will continually search a static
     library while linking. There is no need to specify a static library
     multiple times on the command line.

     A dynamic library (aka dylib or framework) is a final linked image.
     Putting a dynamic library on the command line causes two things: 1) The
     generated final linked image will have encoded that it depends on that
     dynamic library. 2) Exported symbols from the dynamic library are used to
     resolve references.

     Both dynamic and static libraries are searched as they appear on the
     command line.

   Search paths
     ld maintains a list of directories to search for a library or framework to
     use.  The default library search path is /usr/lib then /usr/local/lib.  The
     -L option will add a new library search path.  The default framework search
     path is /Library/Frameworks then /System/Library/Frameworks.  (Note:
     previously, /Network/Library/Frameworks was at the end of the default path.
     If you need that functionality, you need to explicitly add
     -F/Network/Library/Frameworks).  The -F option will add a new framework
     -L option will add a new library search path.  The default framework search
     path is /Library/Frameworks then /System/Library/Frameworks.  (Note:
     previously, /Network/Library/Frameworks was at the end of the default path.
     If you need that functionality, you need to explicitly add
     -F/Network/Library/Frameworks).  The -F option will add a new framework
     search path.  The -Z option will remove the standard search paths.  The
     -syslibroot option will prepend a prefix to all search paths.

   Two-level namespace
     By default all references resolved to a dynamic library record the library
     to which they were resolved. At runtime, dyld uses that information to
     directly resolve symbols.  The alternative is to use the -flat_namespace
     option.  With flat namespace, the library is not recorded.  At runtime,
     dyld will search each dynamic library in load order when resolving symbols.
     This is slower, but more like how other operating systems resolve symbols.

   Indirect dynamic libraries
     If the command line specifies to link against dylib A, and when dylib A was
     built it linked against dylib B, then B is considered an indirect dylib.
     When linking for two-level namespace, ld does not look at indirect dylibs,
     except when re-exported by a direct dylibs.  On the other hand when linking
     for flat namespace, ld does load all indirect dylibs and uses them to
     resolve references.  Even though indirect dylibs are specified via a full
     path, ld first uses the specified search paths to locate each indirect
     dylib.  If one cannot be found using the search paths, the full path is
     used.

   Dynamic libraries undefines
     When linking for two-level namespace, ld does not verify that undefines in
     dylibs actually exist.  But when linking for flat namespace, ld does check
     that all undefines from all loaded dylibs have a matching definition.  This
     is sometimes used to force selected functions to be loaded from a static
     library.

OPTIONS
   Options that control the kind of output
     -execute
             The default.  Produce a mach-o main executable that has file type
             MH_EXECUTE.

     -dylib  Produce a mach-o shared library that has file type MH_DYLIB.

     -bundle

   Indirect dynamic libraries
     If the command line specifies to link against dylib A, and when dylib A was
     built it linked against dylib B, then B is considered an indirect dylib.
     When linking for two-level namespace, ld does not look at indirect dylibs,
     except when re-exported by a direct dylibs.  On the other hand when linking
     for flat namespace, ld does load all indirect dylibs and uses them to
     resolve references.  Even though indirect dylibs are specified via a full
     path, ld first uses the specified search paths to locate each indirect
     dylib.  If one cannot be found using the search paths, the full path is
     used.

   Dynamic libraries undefines
     When linking for two-level namespace, ld does not verify that undefines in
     dylibs actually exist.  But when linking for flat namespace, ld does check
     that all undefines from all loaded dylibs have a matching definition.  This
     is sometimes used to force selected functions to be loaded from a static
     library.

OPTIONS
   Options that control the kind of output
     -execute
             The default.  Produce a mach-o main executable that has file type
             MH_EXECUTE.

     -dylib  Produce a mach-o shared library that has file type MH_DYLIB.

     -bundle
             Produce a mach-o bundle that has file type MH_BUNDLE.

     -r      Merges object files to produce another mach-o object file with file
             type MH_OBJECT.

     -dylinker
             Produce a mach-o dylinker that has file type MH_DYLINKER.  Only
             used when building dyld.

     -dynamic
             The default.  Implied by -dylib, -bundle, or -execute

     -static
             Produces a mach-o file that does not use the dyld.  Only used
             building the kernel.

     -preload
             Produces a mach-o file in which the mach_header, load commands, and
             symbol table are not in any segment.  This output type is used for
             firmware or embedded development where the segments are copied out
             of the mach-o into ROM/Flash.
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

:
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
:
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

:
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

     -weak-lx
             This is the same as the -lx but forces the library and all
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

     -weak-lx
             This is the same as the -lx but forces the library and all
             references to it to be marked as weak imports.  That is, the
:
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

     -weak-lx
             This is the same as the -lx but forces the library and all
             references to it to be marked as weak imports.  That is, the
             library is allowed to be missing at runtime.

:
     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

     -weak-lx
             This is the same as the -lx but forces the library and all
             references to it to be marked as weak imports.  That is, the
             library is allowed to be missing at runtime.

     -needed_library path_to_dylib
             This is the same as placing path_to_dylib on the link line but
             means to really link with the dylib even if no symbols are used
             from it.  Thus, it can be used suppress warnings about unused
             dylibs.

     -reexport_library path_to_library
             This is the same as listing a file name path to a library on the
             link line and it specifies that the all symbols in library path
             should be available to clients linking to the library being
             created.  This was previously done with a separate -sub_library
             option.

     -upward_library path_to_library
             This is the same as listing a file name path to a library on the
             link line but also marks the dylib as an upward dependency.

     -weak_library path_to_library
             This is the same as listing a file name path to a library on the
             link line except that it forces the library and all references to
             it to be marked as weak imports.

     -Ldir   Add dir to the list of directories in which to search for
             libraries.  Directories specified with -L are searched in the order
             they appear on the command line and before the default search path.
             In Xcode4 and later, there can be a space between the -L and
             directory.

     -Z      Do not search the standard directories when searching for libraries
             and frameworks.

     -syslibroot rootdir
             Prepend rootdir to all search paths when searching for libraries or
             frameworks.

     -search_paths_first
             This is now the default (in Xcode4 tools).  When processing -lx the
             linker now searches each directory in its library search paths for
             `libx.dylib' then `libx.a' before the moving on to the next path in
             the library search path.

     -search_dylibs_first
             Changes the searching behavior for libraries.  The default is that
             when processing -lx the linker searches each directory in its
             library search paths for `libx.dylib' then `libx.a'.  This option
             changes the behavior to first search for a file of the form
             `libx.dylib' in each directory in the library search path, then a
             file of the form `libx.a' is searched for in the library search
             paths.  This option restores the search behavior of the linker
             prior to Xcode4.

     -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').

     -needed_framework name[,suffix]
             This is the same as the -framework name[,suffix] but means to
             really link with the framework even if no symbols are used from it.
             Thus, it can be used suppress warnings about unused dylibs.

     -weak_framework name[,suffix]
             This is the same as the -framework name[,suffix] but forces the
             framework and all references to it to be marked as weak imports.
             Note: due to a clang optimizations, if functions are not marked
             weak, the compiler will optimize out any checks if the function
             address is NULL.

ld(1)                        General Commands Manual                       ld(1)

NAME
     ld – linker

SYNOPSIS
     ld files...  [options] [-o outputfile]

DESCRIPTION
     The ld command combines several object files and libraries, resolves
     references, and produces an output 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".

   Universal
     The linker accepts universal (multiple-architecture) input files, but
     always creates a "thin" (single-architecture), standard Mach-O output file.
     The architecture for the output file is specified using the -arch option.
     If this option is not used, ld attempts to determine the output
     architecture by examining the object files in command line order.  The
     first "thin" architecture determines that of the output file.  If no input
     object file is a "thin" file, the native 32-bit architecture for the host
     is used.

     Usually, ld is not used directly.  Instead the compiler driver invokes ld.
     The compiler driver can be passed multiple -arch options and it will create
     a universal final linked image by invoking ld multiple times and then
     running lipo(1) merge the outputs into a universal file.

   Layout
     The object files are loaded in the order in which they are specified on the
     command line.  The segments and the sections in those segments will appear
     in the output file in the order they are encountered in the object files
     being linked.  All zero fill sections will appear after all non-zero fill
     sections in their segments.

   Libraries
     A static library (aka static archive) is a collection of .o files with a
     table of contents that lists the global symbols in the .o files.  ld will
     only pull .o files out of a static library if needed to resolve some symbol
     reference.  Unlike traditional linkers, ld will continually search a static
     library while linking. There is no need to specify a static library
     multiple times on the command line.

     A dynamic library (aka dylib or framework) is a final linked image.
     Putting a dynamic library on the command line causes two things: 1) The
     generated final linked image will have encoded that it depends on that
     dynamic library. 2) Exported symbols from the dynamic library are used to
     resolve references.

     Both dynamic and static libraries are searched as they appear on the
     command line.

   Search paths
     ld maintains a list of directories to search for a library or framework to
     use.  The default library search path is /usr/lib then /usr/local/lib.  The
     -L option will add a new library search path.  The default framework search
     path is /Library/Frameworks then /System/Library/Frameworks.  (Note:
     previously, /Network/Library/Frameworks was at the end of the default path.
     If you need that functionality, you need to explicitly add
     -F/Network/Library/Frameworks).  The -F option will add a new framework
     search path.  The -Z option will remove the standard search paths.  The
     -syslibroot option will prepend a prefix to all search paths.

   Two-level namespace
     By default all references resolved to a dynamic library record the library
     to which they were resolved. At runtime, dyld uses that information to
     directly resolve symbols.  The alternative is to use the -flat_namespace
     option.  With flat namespace, the library is not recorded.  At runtime,
     dyld will search each dynamic library in load order when resolving symbols.
     This is slower, but more like how other operating systems resolve symbols.

   Indirect dynamic libraries
     If the command line specifies to link against dylib A, and when dylib A was
     built it linked against dylib B, then B is considered an indirect dylib.
     When linking for two-level namespace, ld does not look at indirect dylibs,
     except when re-exported by a direct dylibs.  On the other hand when linking
     for flat namespace, ld does load all indirect dylibs and uses them to
     resolve references.  Even though indirect dylibs are specified via a full
     path, ld first uses the specified search paths to locate each indirect
     dylib.  If one cannot be found using the search paths, the full path is
     used.

   Dynamic libraries undefines
     When linking for two-level namespace, ld does not verify that undefines in
     dylibs actually exist.  But when linking for flat namespace, ld does check
     that all undefines from all loaded dylibs have a matching definition.  This
     is sometimes used to force selected functions to be loaded from a static
     library.

OPTIONS
   Options that control the kind of output
     -execute
             The default.  Produce a mach-o main executable that has file type
             MH_EXECUTE.

     -dylib  Produce a mach-o shared library that has file type MH_DYLIB.

     -bundle
             Produce a mach-o bundle that has file type MH_BUNDLE.

     -r      Merges object files to produce another mach-o object file with file
             type MH_OBJECT.

     -dylinker
             Produce a mach-o dylinker that has file type MH_DYLINKER.  Only
             used when building dyld.

     -dynamic
             The default.  Implied by -dylib, -bundle, or -execute

     -static
             Produces a mach-o file that does not use the dyld.  Only used
             building the kernel.

     -preload
             Produces a mach-o file in which the mach_header, load commands, and
             symbol table are not in any segment.  This output type is used for
             firmware or embedded development where the segments are copied out
             of the mach-o into ROM/Flash.

     -arch arch_name
             Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the
             output file should be.

     -o path
             Specifies the name and location of the output file.  If not
             specified, `a.out' is used.

   Options that control libraries
     -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.

     -needed-lx
             This is the same as the -lx but means to really link with the dylib
             even if no symbols are used from it.  Thus, it can be used suppress
             warnings about unused dylibs.

     -reexport-lx
             This is the same as the -lx but specifies that the all symbols in
             library x should be available to clients linking to the library
             being created.  This was previously done with a separate
             -sub_library option.

     -upward-lx
             This is the same as the -lx but specifies that the dylib is an
             upward dependency.

     -hidden-lx
             This is the same as the -lx for locating a static library, but
             treats all global symbols from the static library as if they are
             visibility hidden.  Useful when building a dynamic library that
             uses a static library but does not want to export anything from
             that static library.

     -weak-lx
             This is the same as the -lx but forces the library and all
             references to it to be marked as weak imports.  That is, the
             library is allowed to be missing at runtime.

     -needed_library path_to_dylib
             This is the same as placing path_to_dylib on the link line but
             means to really link with the dylib even if no symbols are used
             from it.  Thus, it can be used suppress warnings about unused
             dylibs.

     -reexport_library path_to_library
             This is the same as listing a file name path to a library on the
             link line and it specifies that the all symbols in library path
             should be available to clients linking to the library being
             created.  This was previously done with a separate -sub_library
             option.

     -upward_library path_to_library
             This is the same as listing a file name path to a library on the
             link line but also marks the dylib as an upward dependency.

     -weak_library path_to_library
             This is the same as listing a file name path to a library on the
             link line except that it forces the library and all references to
             it to be marked as weak imports.

     -Ldir   Add dir to the list of directories in which to search for
             libraries.  Directories specified with -L are searched in the order
             they appear on the command line and before the default search path.
             In Xcode4 and later, there can be a space between the -L and
             directory.

     -Z      Do not search the standard directories when searching for libraries
             and frameworks.

     -syslibroot rootdir
             Prepend rootdir to all search paths when searching for libraries or
             frameworks.

     -search_paths_first
             This is now the default (in Xcode4 tools).  When processing -lx the
             linker now searches each directory in its library search paths for
             `libx.dylib' then `libx.a' before the moving on to the next path in
             the library search path.

     -search_dylibs_first
             Changes the searching behavior for libraries.  The default is that
             when processing -lx the linker searches each directory in its
             library search paths for `libx.dylib' then `libx.a'.  This option
             changes the behavior to first search for a file of the form
             `libx.dylib' in each directory in the library search path, then a
             file of the form `libx.a' is searched for in the library search
             paths.  This option restores the search behavior of the linker
             prior to Xcode4.

     -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').

     -needed_framework name[,suffix]
             This is the same as the -framework name[,suffix] but means to
             really link with the framework even if no symbols are used from it.
             Thus, it can be used suppress warnings about unused dylibs.

     -weak_framework name[,suffix]
             This is the same as the -framework name[,suffix] but forces the
             framework and all references to it to be marked as weak imports.
             Note: due to a clang optimizations, if functions are not marked
             weak, the compiler will optimize out any checks if the function
             address is NULL.

     -reexport_framework name[,suffix]
             This is the same as the -framework name[,suffix] but also specifies
             that the all symbols in that framework should be available to
             clients linking to the library being created.  This was previously
             done with a separate -sub_umbrella option.

     -upward_framework name[,suffix]
             This is the same as the -framework name[,suffix] but also specifies
             that the framework is an upward dependency.

     -Fdir   Add dir to the list of directories in which to search for
             frameworks.  Directories specified with -F are searched in the
             order they appear on the command line and before the default search
             path. In Xcode4 and later, there can be a space between the -F and
             directory.

     -all_load
             Loads all members of static archive libraries.

     -ObjC   Loads all members of static archive libraries that implement an
             Objective-C class or category.

     -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.

     -load_hidden path_to_archive
             Uses specified static library as usual, but treats all global
             symbols from the static library to as if they are visibility
             hidden.  Useful when building a dynamic library that uses a static
             library but does not want to export anything from that static
             library.

     -image_suffix suffix
             Search for libraries and frameworks with suffix and then without
             (e.g. look for `name.framework/name_suffix' first, if not there try
             `name.framework/name', or `libname_suffix.a' first, if not there
             try `libname.a').

   Options that control additional content
     -sectcreate segname sectname file
             The section sectname in the segment segname is created from the
:
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342

推荐阅读更多精彩内容