xcode 在 Xcode4 中使用 Boost

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5288822/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:28:29  来源:igfitidea点击:

Using Boost with Xcode4

c++xcodeboostxcode4

提问by pingu

has anyone setup a C++ Xcode4 project to use Boost? what settings do I need to set in Xcode for a simple C++ console application?

有没有人设置一个 C++ Xcode4 项目来使用 Boost?我需要在 Xcode 中为简单的 C++ 控制台应用程序设置哪些设置?

Thanks

谢谢

回答by pingu

Managed it with this:

用这个管理它:

Link binaries with libraries

将二进制文件与库链接

and this:

和这个:

enter image description here

在此处输入图片说明

回答by Raunak

I would just like to add on to the previous post:

我想补充一下之前的帖子:

After running

运行后

$ sudo port install boost (this can be done once you have macports installed).

$ sudo port install boost(安装 macports 后即可完成)。

libboost_system.dylib and libboost_filesystem.dylib could be found in /opt/local/lib/

libboost_system.dylib 和 libboost_filesystem.dylib 可以在 /opt/local/lib/ 中找到

boost_1_46_1.tar.bz2 will be located in /opt/local/var/macports/distfiles/boost/ Unarchive it, then copy and paste the folder named "Boost" to /usr/local/include/

boost_1_46_1.tar.bz2 将位于 /opt/local/var/macports/distfiles/boost/ 解压它,然后将名为“Boost”的文件夹复制并粘贴到 /usr/local/include/

回答by abnvp

  1. Download the boost libraries for unix from : http://www.boost.org/
  2. Unzip it : Let's say now you have boost in "($USER_NAME)/boost_X_YY_0"
  3. Open your console Application project
  4. Click on top left node in the project directory pane (left hand side). This should be your project name
  5. Build Settings -> Search Paths -> Header Search Paths ->Add the "($USER_NAME)/boost_X_YY_0" path
  6. #include "boost/any.hpp" will work
  1. 从以下位置下载适用于 unix 的 boost 库:http: //www.boost.org/
  2. 解压缩它:假设现在你在“($USER_NAME)/boost_X_YY_0”中有提升
  3. 打开您的控制台应用程序项目
  4. 单击项目目录窗格(左侧)中的左上角节点。这应该是你的项目名称
  5. 构建设置 -> 搜索路径 -> 标题搜索路径 -> 添加“($USER_NAME)/boost_X_YY_0”路径
  6. #include "boost/any.hpp" 会起作用