这个错误的原因,一般是因为windows.h的重复包含。多发生在控制台程序使用MFC共享DLL 时。
解决方案:
1、删除stdafx.h中的#include <Windows.h>
2、调整自己代码中各#include 的包含顺序,将#include <afxwin.h> #include "stdafx.h"等放在首位。
本文介绍了当在控制台程序中使用MFC共享DLL时遇到的Windows.h重复包含错误及其解决方案。通过调整代码中头文件的包含顺序或者移除不必要的Windows.h包含声明,可以有效避免该错误。
这个错误的原因,一般是因为windows.h的重复包含。多发生在控制台程序使用MFC共享DLL 时。
解决方案:
1、删除stdafx.h中的#include <Windows.h>
2、调整自己代码中各#include 的包含顺序,将#include <afxwin.h> #include "stdafx.h"等放在首位。