开发者

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 :

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

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

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

开发者_JS百科

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 . This worked and all the above didn't, so make sure not to forget it .


I installed boost from the installer. It installs the library in c:\program files\boost.

Add the directory to your project's properties like the below

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


Please note that you need to add the path of "boost" directory in both 64bit and 32bit configurations. While adding the path, make sure to select appropriate platform (64bit or 32bit) depending upon your need. If you compile in both versions, you need add both.

Boost library directory is valid for both the above configurations.


For me, I was building targeting the win32 platform. Changing to x64 worked.


I had a similar problem... I'm using 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.

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. 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


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


Add the namespace after all headers:

using namespace std;

removing from the header (.h) did the trick.

remove all the ".h" from all headers. Should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜