遇到msado15 与 dbdaoint.h 有定义冲突
来源:互联网 发布:常州口腔医院挂号软件 编辑:程序博客网 时间:2024/06/10 01:03
1.WINDOWS.H already included. MFC apps must not #include <windows.h>
I just added the
in the <StdAfx.h> file. When the import sentence was add in the head of file,the error occured. But when I moved it to the tail of the file,Everything was OK. I don't know why.
// stdafx.h : include file for standard system include files,
//
//
//
//#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
#if !defined(AFX_STDAFX_H__C914C8D4_56EB_44CD_AE77_600C6D941BA2__INCLUDED_)
#define AFX_STDAFX_H__C914C8D4_56EB_44CD_AE77_600C6D941BA2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","ADOEOF")
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__C914C8D4_56EB_44CD_AE77_600C6D941BA2__INCLUDED_)
1>------ 已启动生成: 项目: iotser, 配置: Debug Win32 ------
1>正在编译...
1>iotser.cpp
1>f:\c++ pro\iocptser\debug\msado15.tlh(228) : error C2011: “LockTypeEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\debug\msado15.tlh(276) : error C2011: “DataTypeEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\debug\msado15.tlh(321) : error C2011: “FieldAttributeEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\debug\msado15.tlh(343) : error C2011: “EditModeEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\debug\msado15.tlh(352) : error C2011: “RecordStatusEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\debug\msado15.tlh(616) : error C2011: “ParameterDirectionEnum”: “enum”类型重定义
1>
1>f:\c++ pro\iocptser\iocptser.cpp(18) : error C2871: “ADODB”: 具有该名称的命名空间不存在
1>生成日志保存在“file://f:\C++ pro\iocptser\Debug\BuildLog.htm”
1>iocptser - 7 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
后来经过在csdn上的搜索发现有下面两种办法来解决这个问题
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", "adoParameterDirectionEnu
- 遇到msado15 与 dbdaoint.h 有定义冲突
- UNP学习第十章,解决unp.h与sctp.h冲突重定义问题
- CCS5.4中xdc与device.h中的数据类型定义冲突
- std::min and std::max与windows.h定义的min和max宏相冲突.
- libcef函数名与windowsx.h宏定义冲突的解决办法
- winsock2.h与afxsock.h的冲突
- winsock.h与winsock2.h冲突解决
- numeric_limits::min()和windows.h有冲突
- 宏定义与枚举定义冲突错误
- DEBUG_NEW 与GDI+ 有冲突
- ffmpeg 0.10由于pixfmt.h 宏定义冲突bug终止
- 在stdafx.h里加入#import msado15.dll出错
- iostream 与afx.h的冲突问题
- Err C2872 win.h 与openCV冲突
- windows.h与winsock2.h冲突问题的解决
- rpm遇到的坑-与VMP冲突
- 关于 winsock.h 与 winsock2.h 中的重定义解决办法
- norton杀毒软件与木马克星有冲突
- 多线程的常用操作方法
- android中mvc,mvp,mvvm学习
- [Linux][gerrit]安装gerrit总结
- 安装了新版本的jdk,修改java_home后,jdk版本始终不变
- Java多线程之线程控制(2)
- 遇到msado15 与 dbdaoint.h 有定义冲突
- Python学习日志_2017-09-09
- Android---长时间在后台运行的定时任务
- 解决安装MathType后Word不能复制粘贴问题
- Flappy Bird项目代码
- 学生中遇到的问题(三)
- 2017年9月11日 晴转多云
- HashMap 里的“bucket”、“负载因子” 介绍
- Date转化问题