Purpose: WebSocket references the Boost library and installs it.
Reference links:
Installation and use of Boost library under Windows_boost installation-CSDN blog
1 Download boost from the official website
First get the boost library, which can be downloaded directly from the official website ( Boost C++ Libraries ). This version number is 1.82.0
2 installation
After decompression is complete, open a DOS window in the directory and enter bootstrap.bat to execute the file.
Double-click b2.exe and wait for the installation to complete.
3 Configure the boost environment in VS
1. Configuration properties->VC++ directory:
(1), "Include directory": the root directory of boost, for example: D:\my_workspace\C_program\C_boost\boost_1_79_0
(2) "Library directory": the link library directory under stage, for example: D:\my_workspace\C_program\C_boost\boost_1_79_0\stage\lib
(3) Optional: Configuration Properties->Linker->General: "Additional Library Directory": Same as the "Library Directory" above, for example: D:\my_workspace\C_program\C_boost\boost_1_79_0\stage\lib
3 tests
Create a new console project in VS and enter the code:
#include <iostream>
#include <boost/version.hpp>
#include <boost/config.hpp>
using namespace std;
int main()
{
cout<<BOOST_VERSION<<endl;
cout<<BOOST_LIB_VERSION<<endl;
cout<<BOOST_PLATFORM<<endl;
cout<<BOOST_COMPILER<<endl;
cout<<BOOST_STDLIB<<endl;
getchar();
return 0;
}
operation result:
4 Install Openssl
After the installation is complete, the Boost file prompts that a series of source files openssl/*.h cannot be opened, so continue to install openssl.
C/C++ programming: openssl usage (win10+vs2019)_openssl/rsa.h_OceanStar's study notes blog-CSDN blog
No errors will be reported after installing and configuring the include directory and library directory.