When creating a new MFC application of the simplest kind in Visual Studio 2012, and setting it to link statically to MFC, linking fails.
Here's a gallery of 7 screenshots starting from the creation of the project via the wizard, up to the building (resulting in the linker error). No source editing was done in-between.
The error logs state:
1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1> stdafx.cpp
1> TestDlg.cpp
1> Test.cpp
1> Generating Code...
1>uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "void __cdecl AfxRegisterMFCCtrlClasses(void)" (?AfxRegisterMFCCtrlClasses@@YAXXZ) already defined in afxnmcdd.lib(afxctrlcontainer2.obj)
1>uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "protected: void __thiscall CMFCControlContainer::PreUnsubclassControl(class CWnd *)" (?PreUnsubclassControl@CMFCControlContainer@@IAEXPAVCWnd@@@Z) already defined in afxnmcdd.lib(afxctrlcontainer2.obj)
1>uafxcwd.lib(afxctrlcontainer2.obj) : error LNK2005: "public: int __thiscall CMFCControlContainer::SubclassDlgControls(void)" (?SubclassDlgControls@CMFCControlContainer@@QAEHXZ) already defined in afxnmcdd.lib(afxctrlcontainer2.obj)
1>C:\Users\XXXXXXXX\Documents\Visual Studio 2012\Projects\Test\Debug\Test.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Is this just me? Would you have a suggestion on how to address this?