When opening a project with Visual Studio 2017 for compilation, the following error was reported:
fatal error C1083: Cannot open include file: "afx.h": No such file or directory
The reason is that the MFC component is not installed, and MFC may not be checked during installation.
1. The solution is to open the Visual Studio Installer, choose to modify,
2. Select C++ desktop development, check the Visual C++ MFC for x86 and x64 on the right,
3. Click Modify in the lower right corner and wait patiently for the installation to complete.
4. Finally restart VS and find that the compilation is passed and you are done.