我正在尝试在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文件夹,并在上瘾的目录中添加了include目录。包含。尽管如此,我仍然收到很多错误,例如:

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


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

谢谢。

最佳答案

好的,这看起来有点混乱。

首先,添加正确的包括:

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


然后,在为msvc2015构建增强功能时,必须选择msvc-14.0工具集而不是msvc-10.0(这是针对msvc2010)和一致的体系结构(32或64)。因此您的构建命令应如下所示:

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

关于c++ - Boost C++和Visual Studio 2015,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37334153/

10-12 21:30