MBCS使用Visual Studio构建MFC C ++项目时出错

时间:2021-08-30 17:04:05

I opened my existing MFC project using Visual Studio and when I build I get the following error message:

我使用Visual Studio打开了现有的MFC项目,当我构建时,我收到以下错误消息:

Error 1 error MSB8031: Use of MBCS encoding in MFC projects require an additional library to be downloaded and installed. Please see http://go.microsoft.com/fwlink/?LinkId=286820 for more information. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\v120\Microsoft.CppBuild.targets

What is this about?

这是关于什么的?

3 个解决方案

#1


39  

This error message is due to the missing MBCS MFC package. Starting with Visual Studio 2013, MBCS portion of the MFC library has been broken out of the Visual Studio product into its own separate download. Installing this package and rebuilding should fix the problem.

此错误消息是由于缺少MBCS MFC程序包。从Visual Studio 2013开始,MFC库的MBCS部分已从Visual Studio产品中分解为单独的下载。安装此软件包并重建应解决问题。

  • The download is available here
  • 可从此处下载

  • More information about this change is available here
  • 有关此更改的更多信息,请访问此处

Update for Visual Studio 2015

Visual Studio 2015的更新

Starting with Visual Studio 2015, the entire MFC C++ library (including the MBCS pieces) is an optional install component. While installing VS2015, if you select C++ and MFC, you will also get the MBCS library.

从Visual Studio 2015开始,整个MFC C ++库(包括MBCS部分)是一个可选的安装组件。在安装VS2015时,如果选择C ++和MFC,您还将获得MBCS库。

#2


8  

Instead of installing an add-on, you may consider changing the character set from MBCS to Unicode.

您可以考虑将字符集从MBCS更改为Unicode,而不是安装附加组件。

This is done in the project properties as is depicted below. MBCS使用Visual Studio构建MFC C ++项目时出错

这在项目属性中完成,如下所示。

#3


0  

For Visual Studio 2015:

对于Visual Studio 2015:

According to Redistributing the MFC Library article on MSDN, there are no mfc140.dll files in redist directory (c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86).

根据MSDN上的MFC库重新分发文章,redist目录中没有mfc140.dll文件(c:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ redist \ x86)。

The mfc140.dll files were omitted from the redistributable files directory in Visual Studio 2015 RTM. You can use the versions installed by Visual Studio 2015 in the Windows\system32 and Windows\syswow64 directories instead.

Visual Studio 2015 RTM中的可再发行文件目录中省略了mfc140.dll文件。您可以在Windows \ system32和Windows \ syswow64目录中使用Visual Studio 2015安装的版本。

#1


39  

This error message is due to the missing MBCS MFC package. Starting with Visual Studio 2013, MBCS portion of the MFC library has been broken out of the Visual Studio product into its own separate download. Installing this package and rebuilding should fix the problem.

此错误消息是由于缺少MBCS MFC程序包。从Visual Studio 2013开始,MFC库的MBCS部分已从Visual Studio产品中分解为单独的下载。安装此软件包并重建应解决问题。

  • The download is available here
  • 可从此处下载

  • More information about this change is available here
  • 有关此更改的更多信息,请访问此处

Update for Visual Studio 2015

Visual Studio 2015的更新

Starting with Visual Studio 2015, the entire MFC C++ library (including the MBCS pieces) is an optional install component. While installing VS2015, if you select C++ and MFC, you will also get the MBCS library.

从Visual Studio 2015开始,整个MFC C ++库(包括MBCS部分)是一个可选的安装组件。在安装VS2015时,如果选择C ++和MFC,您还将获得MBCS库。

#2


8  

Instead of installing an add-on, you may consider changing the character set from MBCS to Unicode.

您可以考虑将字符集从MBCS更改为Unicode,而不是安装附加组件。

This is done in the project properties as is depicted below. MBCS使用Visual Studio构建MFC C ++项目时出错

这在项目属性中完成,如下所示。

#3


0  

For Visual Studio 2015:

对于Visual Studio 2015:

According to Redistributing the MFC Library article on MSDN, there are no mfc140.dll files in redist directory (c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86).

根据MSDN上的MFC库重新分发文章,redist目录中没有mfc140.dll文件(c:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ redist \ x86)。

The mfc140.dll files were omitted from the redistributable files directory in Visual Studio 2015 RTM. You can use the versions installed by Visual Studio 2015 in the Windows\system32 and Windows\syswow64 directories instead.

Visual Studio 2015 RTM中的可再发行文件目录中省略了mfc140.dll文件。您可以在Windows \ system32和Windows \ syswow64目录中使用Visual Studio 2015安装的版本。