从 Xcode 链接到 Boost
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13445064/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linking to Boost from Xcode
提问by rize
I want to compile an Xcode (version 4.5.2.) project using Boost-library. I have successfully installed Boost on my mac and I got the following message:
我想使用 Boost-library 编译一个 Xcode(版本 4.5.2.)项目。我已经在我的 mac 上成功安装了 Boost,我收到以下消息:
The following directory should be added to compiler include paths:
XXX/boost_1_52_0
The following directory should be added to linker library paths:
XXX/boost_1_52_0/stage/lib
How do I add a compiler include path and a linker library path in Xcode? Many thanks.
如何在 Xcode 中添加编译器包含路径和链接器库路径?非常感谢。
回答by WhozCraig
I should mention the following is for Xcode 4.5.2. You should likely mention which version of Xcode you're using in your question.
我应该提到以下是针对 Xcode 4.5.2 的。您可能应该在问题中提及您使用的 Xcode 版本。
- In the Project Navigator select your project file (usually at the top)
- Given the two view choices of Basic or All, choose All in the view pane.
- Locate the Search Pathssection in the settings list
- Locate the Header Search Pathssubsection under Search Paths
- Add the path (absolute or relative to the source folder). You can do it for Debug, Release, or Both.
- 在 Project Navigator 中选择您的项目文件(通常在顶部)
- 给定基本或全部两种视图选择,在视图窗格中选择全部。
- 在设置列表中找到搜索路径部分
- 找到“搜索路径”下的“标题搜索路径”小节
- 添加路径(绝对或相对于源文件夹)。您可以为调试、发布或两者都执行此操作。
And in case you didn't see it, you can add addition library search paths here as well, same area, subsection Library Search Paths
如果您没有看到它,您也可以在此处添加其他库搜索路径,同一区域,小节库搜索路径
Updated for Xcode 5.0.2
为 Xcode 5.0.2 更新
- In the Project Navigator select your project file (usually at the top)
- In the right pane is the project configuration panel. Toward the top-left are two sets of selectable radio options. One says Basic or All, choose All. The second says Combined or Levels, choose Combined.
- Locate the Search Pathssection in the settings list
- Locate the Header Search Pathssubsection under Search Paths
- Add the path (absolute or relative to the source folder). You can do it for Debug, Release, or Both.
- 在 Project Navigator 中选择您的项目文件(通常在顶部)
- 右侧窗格中是项目配置面板。左上角是两组可选择的无线电选项。一个说 Basic 或 All,选择All。第二个是“组合”或“级别”,选择“组合”。
- 在设置列表中找到搜索路径部分
- 找到“搜索路径”下的“标题搜索路径”小节
- 添加路径(绝对或相对于源文件夹)。您可以为调试、发布或两者都执行此操作。