简体   繁体   English

Visual Studio在发布模式下找不到boost包含文件(在调试中工作)

[英]Visual Studio not finding boost include files in release mode (works in debug)

I'm using boost with Visual Studio 2013 Express. 我在Visual Studio 2013 Express中使用了boost。

Visual Studio finds the #include <boost/filesystem.hpp> in Debug mode, but not in Release mode. Visual Studio在调试模式下找到#include <boost/filesystem.hpp> ,但在发布模式下找不到。

When I try to compile in Release mode, it says: 当我尝试在发布模式下编译时,它说:

Error 1 error C1083: Cannot open include file: 'boost/filesystem.hpp': No such file or directory

When I right click on the #include directive to open the file manually, it works in Debug configuration, but again not in Release, there it says: 当我右键单击#include指令手动打开文件时,它在Debug配置中工作,但同样不在Release中,它说:

File 'boost/filesystem.hpp' not found in current source file's directory or in build system paths.

I checked the build configurations and 我检查了构建配置和

  • C/C++ - > General -> "Additional Include Directories" C / C ++ - >常规 - >“其他包含目录”
  • Linker -> General -> "Additional Library Directories" 链接器 - >常规 - >“其他库目录”
  • Linker -> Input -> "Additional Dependencies" 链接器 - >输入 - >“附加依赖项”

Are the same for both configurations. 两种配置都相同。

Do I need to edit the "build system paths", as the error says? 我是否需要编辑“构建系统路径”,如错误所示? I thought that was what the three options above do. 我认为这就是上面三个选项的作用。

What else could cause this problem? 还有什么可能导致这个问题?

Double-check you've checked the settings of the project that actual failed to build. 仔细检查您是否已检查实际无法构建的项目设置。 I had the same issue when using boost::optional . 使用boost :: optional时遇到了同样的问题。 I just overlooked that another project ( UnitTests ) was failing, rather than the project I suspected ( CppPlaygroundLib ) due to misinterpreting the build output by focussing on the line containing the error message: 我只是忽略了另一个项目( UnitTests )失败了,而不是我怀疑的项目( CppPlaygroundLib ),因为通过关注包含错误消息的行来误解构建输出:

1>------ Build started: Project: UnitTests , Configuration: Release Win32 ------ 1> ------ Build build: 项目:UnitTests ,配置:发布Win32 ------

1> FooTests.cpp 1> FooTests.cpp

1>c:\\projects\\playground\\cppplayground\\ cppplaygroundlib \\foo.h(3): fatal error C1083: Cannot open include file: 'boost/optional/optional.hpp': No such file or directory 1> c:\\ projects \\ playground \\ cppplayground \\ cppplaygroundlib \\ foo.h(3):致命错误C1083:无法打开包含文件:'boost / optional / optional.hpp':没有这样的文件或目录

========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ========== ==========构建:0成功,1个失败,2个最新,0跳过==========

After I had added the missing boost path in C/C++->General->Additional Include Directories my solution compiled successfully. C / C ++ - > General-> Additional Include Directories中添加了缺少的boost路径后,我的解决方案编译成功。

Project Property Pages in Visual Studio are not the same for both configurations. Visual Studio中的项目属性页对于两种配置都不相同。 At the Property Page, just set Configuration (top-left) to Release and set configuration for the release build independently. 在Property Page,只需将Configuration(左上角)设置为Release,并独立设置发布版本的配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio Boost不包括在发布模式下 - Visual Studio Boost Not Including in Release Mode 在Visual C ++中以发布模式使用boost的调试库 - Debug libraries of boost getting used in Release mode in visual c++ 调试模式与发布模式下的Visual Studio(C ++)调试 - Visual Studio (C++) debugging in debug mode vs release mode 调试模式和发布模式的时间比较(Visual Studio 2008) - Time comparing on debug mode and release mode(Visual studio 2008) 发布模式与MS Visual Studio Windows中的DEbug模式相同 - Release mode Vs DEbug mode in MS Visual Studio Windows Visual Studio 在发布模式下构建,但用户收到消息说他们需要调试文件 - Visual Studio building in release mode but users get message saying they need debug files Visual Studio 在调试中编译,发布失败(“无法打开包含文件”) - Visual Studio compiles in Debug, fails Release (“Cannot open include file”) Visual Studio 2012不同的值释放/调试模式 - Visual Studio 2012 different values Release/Debug mode 运行时如何在 Visual Studio C++ 中确定调试或发布模式 - Runtime how to determine Debug or release mode in visual studio c++ Visual Studio无法在发布模式下显示“this”的值(带有调试信息) - Visual Studio not able to show the value of 'this' in release mode (with debug information)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM