我在一个CPP中加了几个 *.h 救出现了下面的错误,我感觉好像是编译器的事情,大家帮我看下吧,错误在下面
#include "stdafx.h"
#include "..\..\3D.h"
#include "createtab.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CCreateTab dialog#include "../../../Include/ObjectDLL/Utility/PolyhedronFactory.h"
#include "../../../Include/ObjectDLL/Element/Polyhedron.h"
#include "../../MainFrm.h"
#include "../../ChildFrm.h"
#include "../../3DDoc.h"
#include "../../../Include/ObjectDLL/Scene.h"#pragma comment (lib," ../../../Bin/ObjectDLL.lib " )
CCreateTab::CCreateTab(CWnd* pParent /*=NULL*/)
: CDialog(CCreateTab::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateTab)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCreateTab::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateTab)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateTab, CDialog)
//{{AFX_MSG_MAP(CCreateTab)
ON_BN_CLICKED(IDC_BTN_CUBE, OnBtnCube)
ON_BN_CLICKED(IDC_BTN_PYRAMID, OnBtnPyramid)
ON_BN_CLICKED(IDC_BTN_COLUMN, OnBtnColumn)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CCreateTab message handlersvoid CCreateTab::OnBtnCube()
{
// TODO: Add your control notification handler code here
PolyhedronFactory* pf = new PolyhedronFactory;
Polyhedron* phd = pf->getTypicalPolyhedron(CUBE);
CMainFrame* pMain = ( CMainFrame* )AfxGetMainWnd();
CChildFrame* pChild = ( CChildFrame* )pMain->GetActiveFrame();
CMy3DDoc* pDoc = pChild->GetActiveDocument();
pDoc->scene.insertElement(phd);
delete pf;
}void CCreateTab::OnBtnPyramid()
{
// TODO: Add your control notification handler code here
PolyhedronFactory* pf = new PolyhedronFactory;
Polyhedron* phd = pf->getTypicalPolyhedron(PYRAMID);
CMainFrame* pMain = ( CMainFrame* )AfxGetMainWnd();
CChildFrame* pChild = ( CChildFrame* )pMain->GetActiveFrame();
CMy3DDoc* pDoc = pChild->GetActiveDocument();
pDoc->scene.insertElement(phd); delete pf;
}void CCreateTab::OnBtnColumn()
{
// TODO: Add your control notification handler code here
}
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2809: 'operator new' has no formal parameters
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
error C2809: 'operator new' has no formal parameters
error C2065: '_P' : undeclared identifier
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u
nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)'
error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int
)' have different return types
see declaration of 'new'
error C2809: 'operator new' has no formal parameters
error C2954: template definitions cannot nest
#include "stdafx.h"
#include "..\..\3D.h"
#include "createtab.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CCreateTab dialog#include "../../../Include/ObjectDLL/Utility/PolyhedronFactory.h"
#include "../../../Include/ObjectDLL/Element/Polyhedron.h"
#include "../../MainFrm.h"
#include "../../ChildFrm.h"
#include "../../3DDoc.h"
#include "../../../Include/ObjectDLL/Scene.h"#pragma comment (lib," ../../../Bin/ObjectDLL.lib " )
CCreateTab::CCreateTab(CWnd* pParent /*=NULL*/)
: CDialog(CCreateTab::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateTab)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCreateTab::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateTab)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateTab, CDialog)
//{{AFX_MSG_MAP(CCreateTab)
ON_BN_CLICKED(IDC_BTN_CUBE, OnBtnCube)
ON_BN_CLICKED(IDC_BTN_PYRAMID, OnBtnPyramid)
ON_BN_CLICKED(IDC_BTN_COLUMN, OnBtnColumn)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CCreateTab message handlersvoid CCreateTab::OnBtnCube()
{
// TODO: Add your control notification handler code here
PolyhedronFactory* pf = new PolyhedronFactory;
Polyhedron* phd = pf->getTypicalPolyhedron(CUBE);
CMainFrame* pMain = ( CMainFrame* )AfxGetMainWnd();
CChildFrame* pChild = ( CChildFrame* )pMain->GetActiveFrame();
CMy3DDoc* pDoc = pChild->GetActiveDocument();
pDoc->scene.insertElement(phd);
delete pf;
}void CCreateTab::OnBtnPyramid()
{
// TODO: Add your control notification handler code here
PolyhedronFactory* pf = new PolyhedronFactory;
Polyhedron* phd = pf->getTypicalPolyhedron(PYRAMID);
CMainFrame* pMain = ( CMainFrame* )AfxGetMainWnd();
CChildFrame* pChild = ( CChildFrame* )pMain->GetActiveFrame();
CMy3DDoc* pDoc = pChild->GetActiveDocument();
pDoc->scene.insertElement(phd); delete pf;
}void CCreateTab::OnBtnColumn()
{
// TODO: Add your control notification handler code here
}
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2809: 'operator new' has no formal parameters
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
error C2809: 'operator new' has no formal parameters
error C2065: '_P' : undeclared identifier
error C2061: syntax error : identifier 'THIS_FILE'
error C2091: function returns function
error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u
nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)'
error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int
)' have different return types
see declaration of 'new'
error C2809: 'operator new' has no formal parameters
error C2954: template definitions cannot nest
解决方案 »
- 请教:list control 实现方法
- [tabby] 你帮我看下 如果用游标使用的话,我那代码应该怎么修改?
- 求vs2003用的 mdm.exe
- CDialog* dlg = (CDialog*)GetDlgItem(IDD_DIALOG1); 编译通过,但运行出错! WHY?
- 在OnDraw和OnPaint之外,能否对一个DC进行有效DrawText?
- 求助可调用的画图函数
- 在设置ListCtrl控件各列的对齐方式是发现第一列总是左对齐的,为何?该如何设置第一列的对齐方式?
- 如何修改主菜单?(50)
- gdi+ 单个字符宽度(像素)
- mfc客户区自绘后,想实现标题栏鼠标右键弹出系统菜单,但是我却不能执行菜单项
- 为什么像COM/activex/atl/ole的好书都要绝版?
- 一小段vb代码转成vc代码
#include "..\..\3D.h"
#include "createtab.h"#include "../../../Include/ObjectDLL/Utility/PolyhedronFactory.h"
#include "../../../Include/ObjectDLL/Element/Polyhedron.h"
#include "../../MainFrm.h"
#include "../../ChildFrm.h"
#include "../../3DDoc.h"
#include "../../../Include/ObjectDLL/Scene.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif这样试试。