【问题标题】:Boost cpp and Visual Studio 2015提升 cpp 和 Visual Studio 2015
【发布时间】:2016-09-16 23:29:48
【问题描述】:

我正在尝试在 Visual Studio 2015 上运行 cpp 应用程序。此应用程序是使用 Visual Studio 2010 使用 boost 1.55 开发的,因此我使用 b2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64 stage 编译了库,在链接器部分和包含目录中添加了 dll 文件夹在成瘾包括。尽管如此,我仍然遇到很多错误,例如:

namespace "std" do not include member "time_t"
namespace "std" do not include member "system"

您对我如何解决这个问题有任何想法吗?

谢谢。

【问题讨论】:

  • 如果指定在 64 位中构建 boost,为什么还要指定 32 位架构?
  • 你是#include <ctime> 还是std::time_t#include <cstdlib>std::system

标签: c++ visual-studio boost visual-studio-2015


【解决方案1】:

好吧,这看起来有点乱。

首先,添加正确的包含:

#include <ctime>   //for std::time_t 
#include <cstdlib> // for std::system

然后,在为 msvc2015 构建 boost 时,您必须选择 msvc-14.0 工具集而不是 msvc-10.0(这是用于 msvc2010)和一致的架构(32 或 64)。所以你的构建命令看起来像这样:

b2 --toolset=msvc-14.0 --build-type=complete address-model=64 stage //for 64 bits

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 2012-04-16
    相关资源
    最近更新 更多