//t.h文件:
#include <fcntl.h> 
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
#if !defined(AFX_T_H__23654201_D722_440B_BD7D_B4EA92F4F3F6__INCLUDED_)
#define AFX_T_H__23654201_D722_440B_BD7D_B4EA92F4F3F6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000TERR_NOCARD
class CT
{
private:
........................................
}//错误信息:
--------------------Configuration: schVocice - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
MainFrm.cpp
d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
schVocice.cpp
d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
schVociceDoc.cpp
d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
schVociceView.cpp
d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
T.cpp
d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
Generating Code...
Linking...
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:libraryschVocice.exe - 0 error(s), 6 warning(s)我有至少两个.app引入了t.h头文件.

解决方案 »

  1.   

    #import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no_namespace rename("EOF","adoEOF")把这一句放到
    stdafx.h
      

  2.   

    放入stdafx.h后,会有两个警告:
    //stdafx.h
    #if !defined(AFX_STDAFX_H__58E54EE2_899F_46BB_88A5_56C23307E062__INCLUDED_)
    #define AFX_STDAFX_H__58E54EE2_899F_46BB_88A5_56C23307E062__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
    #include <afxwin.h>         // MFC core and standard components
    #include <afxext.h>         // MFC extensions
    #include <afxdisp.h>        // MFC Automation classes
    #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
    #import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
    #ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h> // MFC support for Windows Common Controls#endif // _AFX_NO_AFXCMN_SUPPORT
    警告信息如下:
    --------------------Configuration: schVocice - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    d:\work\vc\schvocice\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
    Compiling...
    Skipping... (no relevant changes detected)
    MainFrm.cpp
    schVocice.cpp
    schVociceDoc.cpp
    schVociceView.cpp
    T.cpp
    Linking...
    LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:libraryschVocice.exe - 0 error(s), 2 warning(s)
      

  3.   

    warning C4146: unary minus operator applied to unsigned type, result still unsigned这个提示可以不理会(MSDN上说的)你插入位置应该还要靠后
    #if !defined(AFX_STDAFX_H__A1C62A85_F189_43DA_A331_BAAC4A6DF96E__INCLUDED_)
    #define AFX_STDAFX_H__A1C62A85_F189_43DA_A331_BAAC4A6DF96E__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers#include <afxwin.h>         // MFC core and standard components
    #include <afxext.h>         // MFC extensions
    #include <afxdisp.h>        // MFC Automation classes
    #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//加入ADO支持库
    #import "c:\program files\common files\system\ado\msado15.dll"  no_namespace  rename ("EOF", "adoEOF")