Visual Studio在发布模式下找不到boost include文件(在调试中工作)
Visual Studio not finding boost include files in release mode (works in debug)
我在Visual Studio 2013 Express中使用boost。
Visual Studio在调试模式下找到#include <boost/filesystem.hpp>
,而不是在发布模式下。
当我尝试在发布模式下编译时,它说:
Error 1 error C1083: Cannot open include file: 'boost/filesystem.hpp': No such file or directory
当我右键单击#include
指令手动打开文件时,它在调试配置中工作,但再次不在发布中,它说:
File 'boost/filesystem.hpp' not found in current source file's directory or in build system paths.
我检查了构建配置和
- C/c++ -> General -> "Additional Include Directories"
- 链接器->通用-> "附加图书馆目录"
- 链接器->输入->"附加依赖项"
在两种配置中是相同的。
我是否需要编辑"构建系统路径",如错误所说?我认为这就是上面三个选项的作用。
还有什么可能导致这个问题?
再次检查您是否检查了实际构建失败的项目的设置。我在使用boost::optional时遇到了同样的问题。我只是忽略了另一个项目(UnitTests)失败了,而不是我怀疑的项目(CppPlaygroundLib)由于误解了构建输出,专注于包含错误信息的行:
1>------ Build started: Project: UnitTests, Configuration: Release Win32 ------
1比;FooTests.cpp
1>c:projectsplaygroundcppplaygroundcppplaygroundlibfoo.h(3):致命错误C1083:无法打开include文件:'boost/optional/optional.hpp':没有这样的文件或目录
========== 构建:0成功,1失败,2最新的,0跳过 ==========
在C/c++ ->General->Additional Include Directories中添加了缺失的boost路径后,我的解决方案编译成功了。
Visual Studio中的项目属性页对于这两种配置是不一样的。在属性页,只需将Configuration(左上角)设置为Release,并独立地为发布构建设置配置。
- 理解boost::asio-async_read在无需读取内容时的行为
- boost::进程间消息队列引发错误
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- cmake如何在fedora工作站中找到boost静态库包
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 既然存在危险,为什么项目要使用-I include开关
- 什么是"#include <boost/functional/hash.hpp> "?
- Boost 文件在 /usr/local/include 和 /usr/include 中有所不同
- Boost C++ Libaries in Visual Studio 2017 C++ Project - "Cannot open include file"
- /usr/include/boost/filesystem/path.hpp:307:未定义对'boost::files
- 如何使boost::spirit解析器和lexer能够处理include文件
- 添加 #include < boost/asio.hpp>会导致"has different size"问题
- #include<boost> 没有这样的文件或目录
- #include < boost/chrono.hpp> 导致未解析的外部符号,使用 bcp
- 为什么我不能在 /usr/include 中安装 boost?
- MinGw 4.7.0 不使用 #include < boost/线程编译代码>
- 我如何使用find_package在CMakeList.txt中链接Boost(不在usr/include中)
- Visual Studio在发布模式下找不到boost include文件(在调试中工作)
- Eclipse CDT 在不进入包含路径时自动拉入 /usr/include/boost
- 为c++在Eclipse中添加Boost - include路径问题