简体   繁体   English

致命错误 C1083:无法打开包含文件:“boost/config.hpp”:没有这样的文件或目录

[英]fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory

I think I did all the necessary configuration but I am still getting this:我想我做了所有必要的配置,但我仍然得到这个:

Error 1 fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory    File:c:\documents and settings\administrator\my documents\visual studio 2008\libs\boost_1_43_0\boost\smart_ptr\shared_ptr.hpp Line:17

Here are screenshots of setting I have done to add directories for include and lib files:以下是我为包含和 lib 文件添加目录所做的设置的屏幕截图:

1个

2个

3个

Am I missing something?我错过了什么吗?

I finally found the answer:) and I will write it here to help.我终于找到了答案:)我会写在这里帮助。

Project>"YOURPROJECT" Properties>C/C++>General>Additional Include Directories then select where you downloaded your library. Project>"YOURPROJECT" Properties>C/C++>General>Additional Include Directories然后选择你下载库的位置。 This worked and all the above didn't, so make sure not to forget it.这行得通,但以上所有都行不通,因此请确保不要忘记它。

I installed boost from the installer .我从安装程序安装了 boost。 It installs the library in c:\program files\boost.它将库安装在 c:\program files\boost 中。

Add the directory to your project's properties like the below将目录添加到项目的属性中,如下所示

在此处输入图像描述

Please note that you need to add the path of "boost" directory in both 64bit and 32bit configurations.请注意,您需要在 64 位和 32 位配置中添加“boost”目录的路径。 While adding the path, make sure to select appropriate platform (64bit or 32bit) depending upon your need.添加路径时,请确保根据需要选择合适的平台(64 位或 32 位)。 If you compile in both versions, you need add both.如果你在两个版本中编译,你需要添加两个。

Boost library directory is valid for both the above configurations. Boost 库目录对上述两种配置均有效。

For me, I was building targeting the win32 platform.对我来说,我是针对 win32 平台构建的。 Changing to x64 worked.更改为 x64 有效。

I had a similar problem... I'm using Visual Studio 2019 16.6.3.我遇到了类似的问题......我正在使用 Visual Studio 2019 16.6.3。 I think it got stuck somehow.我认为它以某种方式卡住了。 I had upgraded a solution with multiple projects from 2015 to 2019. Most of the projects were building but for some reason one static library (outputting a.lib) kept complaining about some header files.从 2015 年到 2019 年,我升级了一个包含多个项目的解决方案。大多数项目都在构建,但出于某种原因,一个静态库(输出 a.lib)一直抱怨一些头文件。

After several hours, I finally got Visual Studio C++ "unstuck" by disabling: "Project Properties->C/C++->Additional Include Directories->dropdown->Edit...->Checkbox Inherit from parent or project defaults" This seems to have triggered some kind of rebuild of a cache of valid header files or something.几个小时后,我终于通过禁用“项目属性->C/C++->附加包含目录->下拉列表->编辑...->从父项或项目默认值继承的复选框”使 Visual Studio C++“摆脱困境”这似乎触发了某种有效头文件缓存或其他内容的重建。 Now the compiler error has disappeared.现在编译器错误消失了。 I went back into the same dialog and re-enabled "Inherit from parent or project defaults" and things are fine.我回到同一个对话框并重新启用“从父项或项目默认值继承”,一切都很好。

mmake sure you are not looking at boost-system instead of boost-filesystem mmake 确保你不是在看 boost-system 而不是 boost-filesystem

If you're trying to install Turbodbc in a python environment and seeing errors similar to the one mentioned in this question, I have written a detailed answer for this in a different thread - https://stackoverflow.com/a/65850615/5333178如果您尝试在 python 环境中安装 Turbodbc 并看到类似于此问题中提到的错误,我已经在另一个线程中为此编写了详细的答案 - https://stackoverflow.com/a/65850615/5333178

Add the namespace after all headers:在所有标头之后添加命名空间:

using namespace std;

removing from the header (.h) did the trick.从标头 (.h) 中删除就可以了。

remove all the ".h" from all headers.从所有标头中删除所有“.h”。 Should work.应该管用。

暂无
暂无

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

相关问题 致命错误C1083:无法打开包含文件:'boost / variant.hpp':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'boost/variant.hpp': No such file or directory 致命错误 C1083:无法打开包含文件:'opencv2/core.hpp':没有那个文件或目录 - Fatal error C1083: Cannot open include file: 'opencv2/core.hpp': No such file or directory 错误:C1083:无法打开包含文件:'boost/asio.hpp':没有这样的文件或目录 - error: C1083: Cannot open include file: 'boost/asio.hpp': No such file or directory 错误:C1083:无法打开包含文件:'xercesc / util / XMLString.hpp':没有这样的文件或目录 - error: C1083: Cannot open include file: 'xercesc/util/XMLString.hpp': No such file or directory SWIG致命错误C1083:无法打开包含文件 - SWIG Fatal error C1083: Cannot open include file QtCreator中的“致命错误C1083:无法打开包含文件” - “Fatal Error C1083: Cannot open include file” in QtCreator 严重错误C1083:无法打开包含文件:'xmemory':没有此类文件或目录 - fatal error C1083: Cannot open include file: 'xmemory': No such file or directory 严重错误C1083:无法打开包含文件:'mexutils.h':没有此类文件或目录 - fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory 严重错误C1083:无法打开包含文件:“ Item.h”':没有此类文件或目录 - fatal error C1083: Cannot open include file: 'Item.h”': No such file or directory 致命错误 C1083:无法打开包含文件:'fstream.h':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM