如何在Visual Studio 2019上安装MFC

5
我已经在 Windows x64 操作系统上安装了 MFC 扩展程序,使用了以下扩展程序:
  1. C++桌面应用程序开发
  2. C++ v14.26 MFC for v142 build tools (x86 & x64)
  3. C++ v14.26 MFC for v142 build tools with Spectre Mitigations (x86 & x64)
  4. C++ ATL for the v142 build tools
  5. ATL 和 MFC for the v141 build tools
但是当我打开一个新的 MFC 项目并尝试构建它时(即使在编辑之前),我就会得到以下错误: MSB804: 严重性 代码 描述 项目文件 行 抑制状态 错误 MSB8041 此项目需要 MFC 库。为使用的任何工具集和体系结构从 Visual Studio 安装程序(个别组件选项卡)安装它们。 MFCApplication1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets 451 我不知道此时可能缺少哪些库,我认为我已经安装了所有可能的扩展程序。也许有人知道我做错了什么或者我缺少了哪个库?
非常感谢您的帮助。

4
要使用默认设置进行构建,请确保已安装“C++ MFC for latest v142”以及相应的 ATL。 - dxiv
请再提醒我,如何设置使用哪个 MFC 版本? - Stein Åsmul
1个回答

3
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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接