c++编译错误error C2143: syntax error : missing ';' before 'namespace' 请问怎么修改 下面是代码
#if_MSC_VER>1000#pragmaonce#endif#ifndef_EXCEPTION_#define_EXCEPTION_#include<xstddef...
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _EXCEPTION_
#define _EXCEPTION_
#include <xstddef>
#include <eh.h>
#ifdef _MSC_VER
#pragma pack(push,8)
#endif /* _MSC_VER */
#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif
#ifndef _CRTIMP
#ifdef _NTSDK
/* definition compatible with NT SDK */
#define _CRTIMP
#else /* ndef _NTSDK */
/* current definition */
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _NTSDK */
#endif /* _CRTIMP */
typedef const char *__exString;
class _CRTIMP exception
{
public:
exception();
exception(const __exString&);
exception(const exception&);
exception& operator= (const exception&);
virtual ~exception();
virtual __exString what() const;
private:
__exString _m_what;
int _m_doFree;
}
_STD_BEGIN;
using ::exception;
// CLASS bad_exception
class _CRTIMP bad_exception : public exception {
public:
bad_exception(const char *_S = "bad exception") _THROW0()
: exception(_S) {}
virtual ~bad_exception() _THROW0()
{}
protected:
virtual void _Doraise() const
{_RAISE(*this); }
};
_CRTIMP bool __cdecl uncaught_exception();
_STD_END;
#ifdef __RTTI_OLDNAMES
typedef exception xmsg; // A synonym for folks using older standard
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif /* _MSC_VER */
#endif /* _EXCEPTION_ */
error C2143: syntax error : missing ';' before 'namespace'
error C2653: 'ios_base' : is not a class or namespace name
error C2146: syntax error : missing ';' before identifier '_Ios_init'
fatal error C1004: unexpected end of file found 展开
#pragma once
#endif
#ifndef _EXCEPTION_
#define _EXCEPTION_
#include <xstddef>
#include <eh.h>
#ifdef _MSC_VER
#pragma pack(push,8)
#endif /* _MSC_VER */
#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif
#ifndef _CRTIMP
#ifdef _NTSDK
/* definition compatible with NT SDK */
#define _CRTIMP
#else /* ndef _NTSDK */
/* current definition */
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _NTSDK */
#endif /* _CRTIMP */
typedef const char *__exString;
class _CRTIMP exception
{
public:
exception();
exception(const __exString&);
exception(const exception&);
exception& operator= (const exception&);
virtual ~exception();
virtual __exString what() const;
private:
__exString _m_what;
int _m_doFree;
}
_STD_BEGIN;
using ::exception;
// CLASS bad_exception
class _CRTIMP bad_exception : public exception {
public:
bad_exception(const char *_S = "bad exception") _THROW0()
: exception(_S) {}
virtual ~bad_exception() _THROW0()
{}
protected:
virtual void _Doraise() const
{_RAISE(*this); }
};
_CRTIMP bool __cdecl uncaught_exception();
_STD_END;
#ifdef __RTTI_OLDNAMES
typedef exception xmsg; // A synonym for folks using older standard
#endif
#ifdef _MSC_VER
#pragma pack(pop)
#endif /* _MSC_VER */
#endif /* _EXCEPTION_ */
error C2143: syntax error : missing ';' before 'namespace'
error C2653: 'ios_base' : is not a class or namespace name
error C2146: syntax error : missing ';' before identifier '_Ios_init'
fatal error C1004: unexpected end of file found 展开
展开全部
class _CRTIMP exception
{
public:
exception();
exception(const __exString&);
exception(const exception&);
exception& operator= (const exception&);
virtual ~exception();
virtual __exString what() const;
private:
__exString _m_what;
int _m_doFree;
}//这里需要一个分号
_STD_BEGIN;
{
public:
exception();
exception(const __exString&);
exception(const exception&);
exception& operator= (const exception&);
virtual ~exception();
virtual __exString what() const;
private:
__exString _m_what;
int _m_doFree;
}//这里需要一个分号
_STD_BEGIN;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询