简体   繁体   English

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

[英]MBCS Error building MFC C++ project with Visual Studio

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? 这是什么意思

This error message is due to the missing MBCS MFC package. 出现此错误消息是由于缺少MBCS MFC程序包。 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. 从Visual Studio 2013开始,MFC库的MBCS部分已从Visual Studio产品中分解为自己的单独下载。 Installing this package and rebuilding should fix the problem. 安装此软件包并重建应该可以解决该问题。

  • 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. 从Visual Studio 2015开始,整个MFC C ++库(包括MBCS件)是可选的安装组件。 While installing VS2015, if you select C++ and MFC, you will also get the MBCS library. 在安装VS2015时,如果选择C ++和MFC,还将获得MBCS库。

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. 如下所示,这是在项目属性中完成的。 项目属性

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. Visual Studio 2015 RTM中的可再发行文件目录中省略了mfc140.dll文件。 You can use the versions installed by Visual Studio 2015 in the Windows\\system32 and Windows\\syswow64 directories instead. 您可以改用Visual Studio 2015在Windows \\ system32和Windows \\ syswow64目录中安装的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM