I am trying to add boost 1_64 (boost 1_65 will also work) to my Visual Studio 2017 project which includes boost/array.hpp and boost/asio.hpp and used various methods of the same.
I have used the following method https://studiofreya.com/2017/04/23/building-boost-1-64-with-visual-studio-2017/ but I am getting error: cannot open source file "boost/array.hpp" and cannot open source file "boost/asio.hpp" and other errors on the methods of boost.
6.1 Link From Within the Visual Studio IDE Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu. In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\.
Go to Project properties → C/C++ → General → Additional Include Directories, and add a path to the boost library root (in my case C:\Program Files (x86)\Boost_1_53 ). Include a . hpp file in your sources, like #include <boost/lexical_cast/lexical_cast_old. hpp>
Create a Boost.In the Add New Item dialog, expand Installed > Visual C++ > Test. Select Boost. Test, then choose Add to add Test. cpp to your project.
Install Boost (Windows) Download the source code from http://www.boost.org/users/download/. Extract in a Boost folder located at C:\ or C:\Program files so that CMake find-modules can detect it. Invoke the command line and navigate to the extracted folder (e.g. cd C:\Boost\boost_1_63_0 ).
The error implies that you haven't added boost
to the VC++ Directories
.
To add them:
Open the Property Manager
from the View
-> Other Windows
menu.
Click on the project and navigate down to Microsoft.Cpp.x64.user
.
Right click and select Properties
.
Open Common Properties
and select VC++ Directories
Add the directory where you installed boost
to Include Directories
Add the directory where you builtboost
libraries to Library Directories
Also see Boost Getting Started on Windows in case you get stuck elsewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With