有如下代码,出现问题,想大家请教
MyApp.h
// application class
class CMyApp : CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMyFrame : public CFrameWnd
{
public :
CMyFrame();
protected :
//"afx_msg"
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPoint();
DECLARE_MESSAGE_MAP()
};
#include <afxwin.h> //MFC library
#include "MyApp.h"
CMyApp theApp; //the one and only CMyApp Object
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{
Create(NULL,"MyApp Application");
}
void CMyFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %lx,%d,%d\n",(long)nFlags,point.x,point.y);
}
void CMyFrame::OnPoint()
{
CPaintDC dc(this);
dc.TextOut(0,0,"Hello,world!!");
}
这是在VC技术内幕中的 Hello World 的例子,但在编译时出现了如下的错误,
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/MyApp.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
请问是怎么回事呢??
解决即给分。。。 Thanks