- 论坛徽章:
- 0
|
编译时老是出现这个错误:
Deleting intermediate files and output files for project 'Info - Win32 Debug'.
--------------------Configuration: Info - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Info.cpp
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__stdcall CInfo::_GetBaseClass(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of '_GetBaseClass'
e:\project_info\info\information.h(7) : error C2373: 'classCInfo' : redefinition; different type modifiers
e:\project_info\info\information.h(6) : see declaration of 'classCInfo'
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__thiscall CInfo::GetRuntimeClass(void) const' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'GetRuntimeClass'
e:\project_info\info\information.h(7) : error C2535: 'class CObject *__stdcall CInfo::CreateObject(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'CreateObject'
InfoDoc.cpp
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__stdcall CInfo::_GetBaseClass(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of '_GetBaseClass'
e:\project_info\info\information.h(7) : error C2373: 'classCInfo' : redefinition; different type modifiers
e:\project_info\info\information.h(6) : see declaration of 'classCInfo'
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__thiscall CInfo::GetRuntimeClass(void) const' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'GetRuntimeClass'
e:\project_info\info\information.h(7) : error C2535: 'class CObject *__stdcall CInfo::CreateObject(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'CreateObject'
E:\Project_Info\Info\InfoDoc.cpp(61) : error C2678: binary '<<' : no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion)
E:\Project_Info\Info\InfoDoc.cpp(65) : error C2679: binary '>;>;' : no operator defined which takes a right-hand operand of type 'class CObList' (or there is no acceptable conversion)
Information.cpp
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__stdcall CInfo::_GetBaseClass(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of '_GetBaseClass'
e:\project_info\info\information.h(7) : error C2373: 'classCInfo' : redefinition; different type modifiers
e:\project_info\info\information.h(6) : see declaration of 'classCInfo'
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__thiscall CInfo::GetRuntimeClass(void) const' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'GetRuntimeClass'
e:\project_info\info\information.h(7) : error C2535: 'class CObject *__stdcall CInfo::CreateObject(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'CreateObject'
E:\Project_Info\Info\Information.cpp(4) : error C2512: 'CInfo' : no appropriate default constructor available
E:\Project_Info\Info\Information.cpp(5) : warning C4003: not enough actual parameters for macro 'IMPLEMENT_SERIAL'
E:\Project_Info\Info\Information.cpp(5) : warning C4003: not enough actual parameters for macro '_IMPLEMENT_RUNTIMECLASS'
E:\Project_Info\Info\Information.cpp(5) : error C2084: function 'class CObject *__stdcall CInfo::CreateObject(void)' already has a body
E:\Project_Info\Info\Information.cpp(5) : error C2512: 'CInfo' : no appropriate default constructor available
E:\Project_Info\Info\Information.cpp(5) : error C2084: function 'struct CRuntimeClass *__stdcall CInfo::_GetBaseClass(void)' already has a body
E:\Project_Info\Info\Information.cpp(5) : error C2373: 'public: static struct CRuntimeClass const CInfo::classCInfo' : redefinition; different type modifiers
e:\project_info\info\information.h(6) : see declaration of 'public: static struct CRuntimeClass const CInfo::classCInfo'
E:\Project_Info\Info\Information.cpp(5) : fatal error C1903: unable to recover from previous error(s); stopping compilation
InfoView.cpp
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__stdcall CInfo::_GetBaseClass(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of '_GetBaseClass'
e:\project_info\info\information.h(7) : error C2373: 'classCInfo' : redefinition; different type modifiers
e:\project_info\info\information.h(6) : see declaration of 'classCInfo'
e:\project_info\info\information.h(7) : error C2535: 'struct CRuntimeClass *__thiscall CInfo::GetRuntimeClass(void) const' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'GetRuntimeClass'
e:\project_info\info\information.h(7) : error C2535: 'class CObject *__stdcall CInfo::CreateObject(void)' : member function already defined or declared
e:\project_info\info\information.h(6) : see declaration of 'CreateObject'
MainFrm.cpp
Generating Code...
Error executing cl.exe.
Info.exe - 24 error(s), 2 warning(s)
这是Information.h
#ifndef CPP_INFO
#define CPP_INFO
class CInfo:public CObject
{
DECLARE_DYNCREATE(CInfo)
DECLARE_SERIAL(CInfo)
public:
CString m_strName;
CString m_strAddress;
CString m_strPhone;
CString m_strMobile;
CString m_strEmail;
CInfo::CInfo(CString name, CString address, CString phone, CString mobile, CString email);
void Serialize(CArchive &ar);
#ifdef _DEBUG
void Dump(CDumpContext &dc) const;
#endif
};
#endif
请问那里有错阿???是不是这两个DECLARE_DYNCREATE(CInfo)和
DECLARE_SERIAL(CInfo) macro使用有错??不会吧。在.cpp里都有相应的IMPLEMENT_.... |
|