[Disclaimer: some of the content in this article is derived from network information and cannot be determined due to attribution issues. No source of citation is provided here. If you have any copyright issues, please contact us and delete the content suspected of copyright issues in a timely manner !]
Error description:
-------------------- Configuration: myproject-Win32 debug --------------------
Compiling...
Stdafx. cpp
G:/temp/myproject/debug/msado15.tlh (171): Error c2011: 'locktypenum': 'enum' type redefinition
G:/temp/myproject/debug/msado15.tlh (214): Error c2011: 'peypeenum': 'enum' type redefinition
G:/temp/myproject/debug/msado15.tlh (258): Error c2011: 'fieldattributenum': 'enum' type redefinition
G:/temp/myproject/debug/msado15.tlh (279): Error c2011: 'editmodemonum': 'enum' type redefinition
G:/temp/myproject/debug/msado15.tlh (287): Error c2011: 'recordstatusenum': 'enum' type redefinition
G:/temp/myproject/debug/msado15.tlh (407): Warning c4146: unary minus operator applied to unsigned type, result still unsigned
G:/temp/myproject/debug/msado15.tlh (531): Error c2011: 'parameterdirectionenum': 'enum' type redefinition
Error executing cl.exe.
Myproject.exe-6 error (s), 1 warning (s)
Solution:
Solution 1: (1) According to the prompt, redefinition is found; (2) files with errors are concentrated in the debug project file. Try to delete msado15.tlh and build again. the problem persists.
Solution 2: (1) Find the same problem on the Internet; (2) find a solution on csdn and apply it to your own program (method 1 successfully solves 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 ("Expiration", "Expiration") Rename ("editmodeenum", "adoeditmodeenum") Rename ("locktypeenum", "adolocktypeenum") Rename ("recordstatusenum", "Expiration ") rename ("parameterdirectionenum", "adoparameterdirectionenum ")
The result is as follows:
-------------------- Configuration: myproject-Win32 debug --------------------
Compiling...
Stdafx. cpp
Compiling...
Skipping... (no relevant changes detected)
_ Recordset. cpp
Adodc. cpp
Column. cpp
Columns. cpp
Dataformatdisp. cpp
DataGrid. cpp
Field. cpp
Fields. cpp
Font. cpp
Mainfrm. cpp
Myproject. cpp
Myprojectdoc. cpp
Myprojectset. cpp
Myprojectview. cpp
Picture. cpp
Properties. cpp
Property. cpp
Selbookmarks. cpp
Split. cpp
Splits. cpp
Stddataformatsdisp. cpp
Linking...
Myproject.exe-0 error (s), 0 warning (s)
(3) The problem can be solved. The reason is still unclear. You can leave a wedge to be confirmed later.
Background :......................................................................................................