1>------Started Build: Project: Sutest, configuration: Debug Win32------
1> is compiling ...
1>sutest.cpp
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (228): Error C2011: "LockTypeEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (109): see the declaration of "LockTypeEnum"
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (276): Error C2011: "DataTypeEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (138): see the declaration of "DataTypeEnum"
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (321): Error C2011: "FieldAttributeEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (127): See the declaration of "FieldAttributeEnum"
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (343): Error C2011: "EditModeEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (83): see the declaration of "EditModeEnum"
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (352): Error C2011: "RecordStatusEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (341): See the declaration of "RecordStatusEnum"
1>f:/c++ PRO/IOCPTSER/DEBUG/MSADO15.TLH (616): Error C2011: "ParameterDirectionEnum": "Enum" type redefined
1> C:/Program Files/microsoft sdks/windows/v6.0a/include/dbdaoint.h (326): See the declaration of "ParameterDirectionEnum"
1>f:/c++ pro/iocptser/iocptser.cpp (%): Error C2871: "ADODB": a namespace with that name does not exist
1> build log saved in "file://f:/C++ pro/iocptser/debug/buildlog.htm"
1>iocptser-7 an error, 0 warnings
========== Generation: 0 success, 1 failures, latest 0, skipping 0 ==========
The search on csdn later found that there were two ways to solve the problem.
1)
#pragma warning (disable:4146)
#import "C:/Program Files/common files/system/ado/msado15.dll" named_guids rename ("EOF", "adoeof"), rename ("BOF", " Adobof ")
#pragma warning (default:4146)
using namespace ADODB;
2)
#pragma warning (disable:4146)
#import "C:/Program Files/common files/system/ado/msado15.dll"/
No_namespace/
Rename ("EOF", "adoeof") Rename ("DataTypeEnum", "Adodatatypeenum")
Rename ("FieldAttributeEnum", "Adofielattributeenum") Rename ("EditModeEnum", "Adoeditmodeenum")
Rename ("LockTypeEnum", "Adolocktypeenum") Rename ("RecordStatusEnum", "Adorecordstatusenum")
Rename ("ParameterDirectionEnum", "Adoparameterdirectionenum")
Or the workaround is as follows:
Project-> Setting-> + +->perprocessor->perprocessor definitions: Add macros inside _afx_no_dao_support