One, error C1189: #error: WINDOWS. H already included. MFC apps must not #include <windows.h>
This error is often reported when we introduce MFC into the Win32 application that we built in vs2013. This is because WINDOWS.H has been introduced into MFC's class library files,
In VS, each. App file introduces the stdafx.h header file by default, and the following code is the entire contents of stdafx.h, which is also introduced into the WINDOWS.H
#include "Targetver.h"
#define Win32_lean_and_mean
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
The workaround is to delete the #include<windows.h> in the stdafx.h header file.
Two, error LNK2005: "Void __cdecl operator delete (void *)" (?? 3@YAXPAX@Z) has been defined in LIBCMTD.lib (dbgdel.obj)
In MFC's class library, the void __cdecl operator delete (void *) method is defined more than once, nafxcw.lib and LIBCMT.lib are defined, and when we introduce an MFC class library
The two files will be introduced by default, and many times we will need these two files.
The solution is to click on my Items >> right button to select Properties >> Configuration Properties >> General >> Scroll down >> find MFC using the >> set to use MFC in shared DLLs.