我已经通过命令行(命令提示符)使用 MSVC 工具集安装了 boost。
现在,我想知道应该在我的项目属性中包含哪些目录。
自从我将以下行添加到我的项目中:
#include <filesystem\fstream.hpp>
它抛出以下错误:
1>c:\boost\boost_1_56_0\boost\filesystem\fstream.hpp(15): fatal error C1083:
Cannot open include file: 'boost/config.hpp': No such file or directory
我已将以下内容添加到我的库的项目属性目录中:
C:\boost\boost_1_56_0\boost
C:\boost\boost_1_56_0\stage\lib
这是我添加上述路径的地方:
(Project->Properties->VC++ Directories->Library Directories
最佳答案
不要将 boost
子目录添加到搜索路径;添加父级
C:\boost\boost_1_56_0
并在包含 header 时指定 boost
目录
#include <boost/filesystem/fstream.hpp> // Better to use / not \ for portability
Boost header 像这样相互包含(路径中有 boost/
),所以现在也可以找到它们。
关于c++ - Boost 库和 Visual Studio 2013,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25616679/