c++ - 在 Windows 上使用 Boost (Visual Studio)

标签 c++ windows visual-studio visual-c++ boost

我想开始使用 Boost。我正在 Visual Studio 中编写 C++ 程序(显然是在 Windows 计算机上)。

Boost 的 Getting Started Guide说:

The easiest way to get a copy of Boost is to use an installer. The Boost website version of this Getting Started guide will have undated information on installers as they become available, or see Boost downloads or the installer provided by BoostPro Computing. We especially recommend using an installer if you use Microsoft Visual Studio, because the installer can download and install precompiled library binaries, saving you the trouble of building them yourself.

我有点不确定是要听从这个建议,还是自己下载并构建所有内容。我在安装程序中看到的潜在问题是:

  1. 事情不再是独立的(即每个团队成员都必须安装 Boost,然后配置 Visual Studio 以识别它)。
  2. 我无法将 Boost 置于源代码控制之下(理想情况下,我希望它像其他所有内容一样成为源代码控制中的源文件)。 (编辑:从评论来看,boost 似乎有点大(5 GB!),所以显然我只需要将其中的一部分保留在源代码管理之下。

所以我的问题是,我是偏执狂应该走安装程序路线,还是我正确应该自己构建?如果有人有任何使用 Boost 和 Visual Studio 的经验,我将不胜感激,如果他们可以分享他们对此的看法(如果应该自己构建它,任何提示也将不胜感激,例如我是否应该只复制每个文件我实际使用的?等等)。

注意:

StackOverflow 上有几个类似的问题,但没有明确提出这个问题,这让我觉得我不应该使用安装程序,这就是我在这里明确提出问题的原因。作为引用,这些是问题:

  1. Boost linking, Visual Studio & version control
  2. Including Relevant Boost Libraries with C++ Source (Using Visual Studio)

最佳答案

确保每个人都正确配置所有内容的一个好方法是使用 svn externals。您可以创建类似 /trunk/boost1.35 的内容,然后您可以使用外部 svn 指向它。

这样随着新版本的 boost 的出现,你可以将你的 svn 重新指向 /trunk/boost1.40

在您的存储库中,您的 svn external 指向存储库中的那个 svn 文件夹。示例 /depends/boost

我们个人按照描述将 boost 头文件置于源代码控制之下,但将库保存为 zip 文件,我们要求每个人都下载。我们有一个类似于以下 BOOST_LIB 的环境变量,我们将其指向当前的 boost 库目录。

关于c++ - 在 Windows 上使用 Boost (Visual Studio),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1790291/

相关文章:

visual-studio - 使用不同版本的项目,该项目是使用不同版本的 Typescript 构建的

c++ - 使用常量长度时 char[] 和 new char[] 之间的区别

c++ - 这些编译器之间有什么区别吗?

visual-studio - SSRS - 一次将 Reporting Services 报表部署到多个服务器

windows - Windows 窗体中的 ComboBox Datagridview 控件

c++ - 窗口移动后点击坐标

Python 无法在 r+ 模式下打开 11gb csv 但在 r 模式下打开

c++ - 未初始化的变量读取错误

c++ - GCC 中更详细的 C++17 状态?

c++ - 使用默认构造函数初始化对象