如何在 Visual Studio 2019 上安装 MFC

use*_*875 6 mfc visual-studio

我已使用以下扩展在 Windows x64 操作系统上安装了 VS 2019 版本 16.7 的 MFC 扩展:

  1. 使用 C++ 开发桌面应用程序
  2. 适用于 v142 构建工具的 C++ v14.26 MFC(x86 和 x64)
  3. C++ v14.26 MFC for v142 构建工具,具有 Spectre 缓解功能(x86 和 x64)
  4. 用于 v142 构建工具的 C++ ATL
  5. v141 构建工具的 ATL 和 MFC

但是当我打开一个新的 MFC 项目并尝试构建它时,甚至在编辑之前,我收到以下错误: MSB804: Severity Code Description Project File Line Suppression State Error MSB8041 MFC libraries are required for this project. Install them from the Visual Studio installer (Individual Components tab) for any toolsets and architectures being used. MFCApplication1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets 451

我不知道此时可能会缺少哪些库,我想我已经安装了所有可能的扩展。也许有人知道我做错了什么或者我错过了什么图书馆?

非常感谢。

小智 5

Open Visual Studio Installer - > Modify - & gt; 
For a single component, select install:
    C++ATL for v142 (x86 and x64)
    C++MFC for v142 (x86 and x64)
    C++ v14.21 ATL for v142 (x86 and x64)
    C++v14.21 MFC for v142 (x86 and x64)

If the same error still occurs, install
    C++ATL for the latest v142 build tools
    C++ MFC for the latest v142 build tool
Run Code Online (Sandbox Code Playgroud)