出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
2012-03-09 00:00
218 查看
ado.h,ado.cpp等是一个ado封装类 ,较容易使用,流传很广
但是在工程应用或封装为动态库时经常会出现:
:error C2872: 'DataTypeEnum' : ambiguous symbol
: error C2872: 'ParameterDirectionEnum' : ambiguous symbol
等类似错误,网上给出的一些解决方法都是治标不治本,比如使用namespace ,
rename("DataTypeEnum","adoDataTypeEnum"),在DataTypeEnum前使用ADODB::域引用等.
error C2872错误,究其根本是该类型同名出现多个数据库类下,所以我们只要把不需要的数据库支持类去掉即可,经过察看stdafx.h头文件,发现在里面默认启动了MFC DAO数据库类支持,而该类里面同时定义了与ADO类相同的枚举类型等定义,
因此注释掉stdafx.h里面的dao包含文件即可:
//#ifndef _AFX_NO_DAO_SUPPORT
//#include <afxdao.h> // MFC DAO database classes
//#endif // _AFX_NO_DAO_SUPPORT
http://www.cnblogs.com/strinkbug/archive/2007/03/30/694369.html
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/augusdi/article/details/4261683
但是在工程应用或封装为动态库时经常会出现:
:error C2872: 'DataTypeEnum' : ambiguous symbol
: error C2872: 'ParameterDirectionEnum' : ambiguous symbol
等类似错误,网上给出的一些解决方法都是治标不治本,比如使用namespace ,
rename("DataTypeEnum","adoDataTypeEnum"),在DataTypeEnum前使用ADODB::域引用等.
error C2872错误,究其根本是该类型同名出现多个数据库类下,所以我们只要把不需要的数据库支持类去掉即可,经过察看stdafx.h头文件,发现在里面默认启动了MFC DAO数据库类支持,而该类里面同时定义了与ADO类相同的枚举类型等定义,
因此注释掉stdafx.h里面的dao包含文件即可:
//#ifndef _AFX_NO_DAO_SUPPORT
//#include <afxdao.h> // MFC DAO database classes
//#endif // _AFX_NO_DAO_SUPPORT
http://www.cnblogs.com/strinkbug/archive/2007/03/30/694369.html
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/augusdi/article/details/4261683
相关文章推荐
- 出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
- 出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
- 出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
- 出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
- 出现:'DataTypeEnum' : ambiguous symbol 错误怎么办?
- VC编译出现ambiguous symbol的错误
- ActionBar之style出现Cannot resolve symbol 'Theme' 错误
- 出现ORA-03115:unsupported network datatype or representation错误的解决方法
- Titanium -- 运行app出现错误: TypeError: argument of type 'NoneType' is not iterable
- mount目录访问出现“Value too large for defined data type”错误解决办法
- VMware共享文件夹编译出现“Value too large for defined data type”错误的解决办法
- 使用duilib出现“error C2872: 'CRect' : ambiguous symbol”等错误
- 执行sql出现No Dialect mapping for JDBC type: -9错误
- Linux mount Windows共享后编译出现“Value too large for defined data type”的问
- [置顶] android使用getItemViewType时出现java.lang.ArrayIndexOutOfBoundsException的错误
- 我的2005在add new data source的时候,出现下列错误!
- 用keil写程序时出现“C(162): error C249: 'DATA': SEGMENT TOO LARGE“的错误
- java eclipse 出现 xxx cannot be resolved to a type 错误解决方法
- android databinding不出现具体错误':app:compileDebugJavaWithJavac'. > Compilation failed;
- Eclipse编写C++出现Symbol 'std' could not be resolved错误提示的解决方案