file not found with include; use "quotes" instead 这个错误提示不能使用大括号来引用静态库而要使用“”来引用静态库
下面讲解下如何 在工程中使用 来引用静态库。 在自己添加的.a 静态库中 如何 使用来引用头文件
1.先建立一个APPDemo工程
2.建立一个静态库工程 在新建静态库工程时将 这个静态库工程 添加到APPDemo工程中,这个很简单。
3.这样的静态库能直接用的只不过 引用时 使用的是#import “” 来 引用 静态库的头文件,就能顺利编译了。 但是 我看着 很难受 既然是静态库 就要搞得 牛逼点。最好能用#import来引用静态库的头文件 这样才像静态库的样子。
使用步骤如下:在 自己的静态库里面的 -> Build Settings -> Packaging 选项下(不好找的话在 Search Paths 选项上边) 找到 Public Headers Folder Path 默认 为 /usr/local/include 将这个选择 改为 自己 想要的路径 如 include/wifilib 改好后再 Build Phases -> Copy Files 找到 Subpath 选项 将 内容 改为 刚才 修改的名字 如 改为 include/wifilib
4.这样的话 在 APPDemo工程 里面 应用 静态库 的头文件时 就可以 #import了。
5.添加依赖简单,进入target“MyLib”的“Build Phases”,展开“Target Dependencies”,添加“静态库”。这样就添加了wifilib的依赖,在编译APPDemo时,编译器就会去编译wifilib 了。
下面 详细 讲讲 xcode 的工程 依赖
https://developer.apple.com/library/ios/featuredarticles/XcodeConcepts/Concept-Targets.html
首先附上原文地址:
http://developer.apple.com/library/mac/#featuredarticles/XcodeConcepts/Concept-Targets.html#//apple_ref/doc/uid/TP40009328-CH4-SW1
然后,粘贴原文,怕以后苹果改了文档连接…
第一版,以后还要逐步修改,更加贴切
Xcode Target
Related Articles
- Build Settings
- Xcode Scheme
- Xcode Workspace
A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. A target defines a single product; it organizes the inputs into the build system—the source files and instructions for processing those source files—required to build that product. Projects can contain one or more targets, each of which produces one product.
The instructions for building a product take the form of build settings and build phases, which you can examine and edit in the Xcode project editor. A target inherits the project build settings, but you can override any of the project settings by specifying different settings at the target level. There can be only one active target at a time; the Xcode scheme specifies the active target.
A target and the product it creates can be related to another target. If a target requires the output of another target in order to build, the first target is said to depend upon the second. If both targets are in the same workspace, Xcode can discover the dependency, in which case it builds the products in the required order. Such a relationship is referred to as an implicit dependency. You can also specify explicit target dependencies in your build settings, and you can specify that two targets that Xcode might expect to have an implicit dependency are actually not dependent. For example, you might build both a library and an application that links against that library in the same workspace. Xcode can discover this relationship and automatically build the library first. However, if you actually want to link against a version of the library other than the one built in the workspace, you can create an explicit dependency in your build settings, which overrides this implicit dependency.
翻译一下,为了自己能更懂。
Xcode Target
产品,
产品的。一个Target定一个单独的产品;它管理组织在这个编译系统中,需要用来编译这个产品的输入(输入既是源文件和处理这些源文件的指令)。
(build settings)和’编译阶段’
(build phases)这两个形式存在,你在Xcode的工程编辑器中可以查看和编辑这两项。
(ps:也就是你通过修改这两个内容来达到编辑工程指令的目的,你就是用这种方式来修改和输入编译指令的)
Target 沿袭工程编译设置内容,但是你可以在Targe层通过指定不同的属性设置来重写任何工程设置。同一时间只能存在一个活动的Target;
Xcode Scheme 指定活动的Target。
(build settings)中指定明显的Target依赖,你可以指定在Xcode可能会期望两个target中存在隐含依赖的关系为非依赖关系。例如,你可能编译一个库文件和一个程序文件,程序文件内部链接了这个库文件,那么Xcode会发现这个这个关系并且自动先编译库文件。然而,如果你事实上想要链接的不是此版本的库文件 ,也就是不想链接这个库文件新编译出来的,你可以在你的编译设置(build settings)里创建一个明显的依赖关系,来覆盖这个隐含依赖。
原版原文:
Xcode Target
A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. A target defines a single product; it organizes the inputs into the build system—the source files and instructions for processing those source files—required to build that product. Projects can contain one or more targets, each of which produces one product.
The instructions for building a product take the form of build settings and build phases, which you can examine and edit in the Xcode project editor. A target inherits the project build settings, but you can override any of the project settings by specifying different settings at the target level. There can be only one active target at a time; the Xcode scheme specifies the active target.
A target and the product it creates can be related to another target. If a target requires the output of another target in order to build, the first target is said to depend upon the second. If both targets are in the same workspace, Xcode can discover the dependency, in which case it builds the products in the required order. Such a relationship is referred to as an implicit dependency. You can also specify explicit target dependencies in your build settings, and you can specify that two targets that Xcode might expect to have an implicit dependency are actually not dependent. For example, you might build both a library and an application that links against that library in the same workspace. Xcode can discover this relationship and automatically build the library first. However, if you actually want to link against a version of the library other than the one built in the workspace, you can create an explicit dependency in your build settings, which overrides this implicit dependency.
Related Articles
- Build Settings
- Xcode Scheme
- Xcode Workspace
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: 中国类Instagram拍照应用盘点 谁将笑到最后
2012年6月3日被广泛看好的Instagram最有力的竞争对手PicPlz由于Instagram的飞速发展,再加上Instagram又攀上了Facebook这棵大树,生存空间一再被挤压,终于在其官博上发布了即将关闭图片服务的声明。在国外Instagram的对…