Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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?

like image 870
Raman Sharma Avatar asked Oct 26 '13 06:10

Raman Sharma


2 Answers

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.

  • The download is available here
  • More information about this change is available here

Update for 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.

like image 184
Raman Sharma Avatar answered Sep 17 '22 17:09

Raman Sharma


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

This is done in the project properties as is depicted below. project properties

like image 39
ragnarius Avatar answered Sep 21 '22 17:09

ragnarius