Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
MSB8041: MFC/ATL Libraries are required for this project.
This error occurs when MFC or ATL is required for a build, but it wasn't found.
MFC and ATL libraries aren't installed by default when you install a C++ workload in Visual Studio. To fix the error, make sure the right versions of MFC and ATL libraries for your build toolset are installed. There are versions of MFC for each version of the C++ build tools, for each target platform, and with or without Spectre mitigations. For example, C++ MFC for latest v143 build tools (x86 and x64) has the x86 and x64 libraries without Spectre mitigations for the latest version of Visual Studio 2022 (v143). If you simply want to use the latest libraries for a given version of a Visual Studio toolset, you need C++ MFC for latest [version] build tools ([target]) for non-Spectre builds and C++ MFC for latest [version] build tools with Spectre Mitigations ([target]) for Spectre mitigated builds. Choose the correct option for your target platform architecture. The others are for cases where you're specifically targeting an earlier toolset. For more information, see MFC Library Versions.
For more information about modifying Visual Studio to install the libraries and binaries you need, see Modify Visual Studio.
For detailed build troubleshooting, this error is triggered in the C++ build process in the MSBuild target Microsoft.CppBuild.targets when the following file isn't found: $(VCToolsInstallDir)atlmfc\lib\$(_SpectreLibsDir)$(PlatformShortName)\mfcs140.lib
. The properties come from the environment ($(VCToolsInstallDir)
) and the project configuration: $(_SpectreLibsDir)
is empty or spectre\
, $(PlatformShortName)
is x86
, x64
, arm
, arm64
, or arm64EC
.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today