我在安装VS2010之后发生了一次驱动器崩溃,之前我有过VS2005,一切都很好。错误C1189安装Visual Studio 2010之后
现在编译一个以前很好的C++应用程序,我看到了一些我无法弄清楚的错误。
错误1错误C1189:#error:此文件要求_WIN32_WINNT至少定义为0x0403。建议值0x0501或更高。 C:\ Program Files文件\微软的Visual Studio 10.0 \ VC \ atlmfc \ \包括35 atlcore.h 1 BIOXGINA
#ifndef __ATLCORE_H__
#define __ATLCORE_H__
#pragma once
#ifdef _ATL_ALL_WARNINGS
#pragma warning(push)
#endif
#pragma warning(disable: 4786) // identifier was truncated in the debug information
#pragma warning(disable: 4127) // constant expression
#include <atldef.h>
#include <windows.h>
#include <ole2.h>
#include <limits.h>
#include <tchar.h>
#include <mbstring.h>
#include <atlchecked.h>
#include <atlsimpcoll.h>
34. #if _WIN32_WINNT < 0x0403
35. #error This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.
36. #endif
#pragma pack(push,_ATL_PACKING)
namespace ATL
{
/////////////////////////////////////////////////////////////////////////////
// Verify that a null-terminated string points to valid memory
inline BOOL AtlIsValidString(
_In_z_count_(nMaxLength) LPCWSTR psz,
_In_ size_t nMaxLength = INT_MAX)
{
(nMaxLength);
return (psz != NULL);
}
如果我注释掉上面的行,我再拿到
错误下面第111行未找到C3861标识符。
我认为我只是得到这个,因为我评论了上面的几行?
HRESULT Init() throw()
{
HRESULT hRes = S_OK;
111. if (!InitializeCriticalSectionAndSpinCount(&m_sec, 0))
{
hRes = HRESULT_FROM_WIN32(GetLastError());
}
return hRes;
}
我希望对此有任何帮助。真的不希望重新安装2005
而不是更改系统文件stdafx。h,我选择在我的项目的预处理器定义中设置它们。比修补系统.h文件更便于携带。 – 2013-02-16 13:42:00
@PeteMagsig:'stdafx.h'不是系统文件。它的代码被新建项目向导自动放置到项目中,成为预编译头文件的焦点,但它不会与其他任何文件共享。 (文件名是可怕的) – 2013-05-19 04:22:58
@ BenVoigt:谢谢你指出。我没有意识到这是stdafx.h的来源。我仍然赞成在编译器配置中使用预处理器定义。 – 2013-05-19 12:44:17