visual-studiovisual-c++boostvisual-studio-2022vcpkg

Cannot open include file: No such file or directory, but it exists in Additional Include Directory


When trying to build a C++ project in Visual Studio 2022 I get:

Cannot open include file: 'boost/asio.hpp': No such file or directory

Include line causing error:

#include <boost/asio.hpp>

But I did include the path to this file through Additional Include Directories already.

enter image description here

In my user's desktop directory x64-windows\include folder contains boost folder, which contains the included asio.hpp file. It also contains asio folder.

Edit: Changing <boost/asio.hpp> to "boost/asio.hpp" doesn't help.


Solution

  • This fixed it for me:

    .\\vcpkg.exe integrate install
    

    it returned:

    Applied user-wide integration for this vcpkg root.
    
    All MSBuild C++ projects can now #include any installed libraries.
    Linking will be handled automatically.
    Installing new libraries will make them instantly available.
    

    Now the project compiles without any problem.