不懂VC,拿了个VC源代码编译却出现下列错误提示,请各位多多指教,到底是哪出了问题?
e:\work\box\release\msado15.tlh(169) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
e:\work\box\release\msado15.tlh(212) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
e:\work\box\release\msado15.tlh(256) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
e:\work\box\release\msado15.tlh(277) : error C2011: 'EditModeEnum' : 'enum' type redefinition
e:\work\box\release\msado15.tlh(285) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
e:\work\box\release\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
e:\work\box\release\msado15.tlh(527) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition

解决方案 »

  1.   

    LockTypeEnum等等这些变量 重定义 了 。你检查一下是否有两个以上的地方enum了LockTypeEnum
      

  2.   

    你是用的ado吧,而且你的工程还选择了database include header选项了吧。
    你要去掉stdafx.h中的这几段话即可。#ifndef _AFX_NO_DB_SUPPORT
    #include <afxdb.h> // MFC ODBC database classes
    #endif // _AFX_NO_DB_SUPPORT#ifndef _AFX_NO_DAO_SUPPORT
    #include <afxdao.h> // MFC DAO database classes
    #endif // _AFX_NO_DAO_SUPPORT
      

  3.   

    这个错误提示几个单词的意思还是知道,但就是不知道怎么解决,按gao_ming77(小明)的方法好像也不行,去掉第一段时错误提示有6个(就是上面问题里列出的6个)如果去掉第二段有195个错误,如果把这两段都去掉则有198个错误
      

  4.   

    我检查了头文件里,并没有什么地方有定义这几个变量,这个MSADO15.tlh是自动生成的,是不是哪个系统头文件里有定义,而程序里在哪个地方引用了两次这个头文件造成的?
      

  5.   

    这样吧,你把你的stdafx.h贴上来看看?
      

  6.   

    去掉第一段时错误提示有6个(就是上面问题里列出的6个)如果去掉第二段有195个错误,如果把这两段都去掉则有198个错误是不是你有用到DAO和ODBC访问数据库呀?
    你还要用ADO么?这样试试,你把你的#import".....\msado15.dll"后面的no_namespace这个词去掉。
    这样在导入的时候会默认生成一个ADODB的名字空间,你再使用ADO对象的时候,需要加上名字空间。
      

  7.   

    按照gao_ming77(小明)的最后一个方法,解决了