VS 2010中的VS Compile错误包括标题

时间:2015-07-08 01:29:07

标签: c++ visual-studio-2010 compiler-errors header-files

使用VS2010编译代码时遇到了一个问题。我在SDK标题中遇到以下100多个错误。当我用VS2013和V120编译完全相同的代码时,它工作正常。 我在以下链接中发现了类似的问题,但它没有起作用。 [Visual Studio 2010 and windows SDK 7.0a compilation error

1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5472): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5497): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5507): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5525): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5544): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5569): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(5579): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C2146: syntax error : missing ';' before identifier '_pchBuf'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(303): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C2146: syntax error : missing ';' before identifier '_pszFound'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(306): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C2146: syntax error : missing ';' before identifier '_pszExpected'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(410): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(535): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(596): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(599): error C2061: syntax error : identifier 'BSTR'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\msxml.h(602): error C2061: syntax error : identifier 'BSTR'

对于Jonathan的问题,主cpp中的include部分如下:

// Defines the entry point for the console application.
//
#include "stdafx.h"
#define _CRTDBG_MAP_ALLOC 
#include <stdlib.h>
#include <crtdbg.h>

#include <math.h>
//----------------------------------------------------------------------------------
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <afx.h>
#include <time.h>
#include <stdlib.h>
#include <map>
#include <direct.h>
// insert specific include here
#include "recordSet.h"
#define  roundX(x)  ( floor(100.0 * x + 0.49 )) / 100  ;
#include "OutputAccumulator.h"
using namespace std;

这是stdfax.h的代码:

#pragma warning(disable : 4786) 

#if !defined(AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_)
#define AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers

#include <afx.h>
#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdao.h>         // MFC DAO database 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

#include <iostream>


#define     VERY_SMALL_VALUE    0.0000001

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__25F9CFE5_5C52_11D5_98E7_000255667102__INCLUDED_)

感谢您的任何见解!

0 个答案:

没有答案