首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

初学者请问有关问题哈~多谢各位呀~

2012-03-06 
菜鸟请教问题哈~~~~~~谢谢各位呀~~~~~~~~~~~~我的程序#include afxwin.hclassCHelloApp:publicCWinApp{p

菜鸟请教问题哈~~~~~~谢谢各位呀~~~~~~~~~~~~
我的程序

#include <afxwin.h>
class   CHelloApp:public   CWinApp
{
public:
virtual   BOOL   InitInstance();
};
CHelloApp   theApp;
class   CMainFrame:public   CFrameWnd
{
public:
CMainFrame()
{
Create(NULL, "my   form ",WS_OVERLAPPEDWINDOW,CRect(0,0,400,300));
}
protected:
afx_msg   void   OnLButtonDown(UINT   nFlags,CPoint   point);
DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CMainFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()

void   CMainFrame::OnLButtonDown(UINT   nFlags,CPoint   point)
{
MessageBox( "hello,the   world   of   my   c++ ", "information ",0);
CFrameWnd::OnLButtonDown(nFlags,point);
}

BOOL   CHelloApp::InitInstance()
{
m_pMainWnd=new   CMainFrame();
m_pMainWnd-> ShowWindow(m_nCmdShow);
m_pMainWnd-> UpdateWindow();
return   TRUE;
}


错误提示:
--------------------Configuration:   Ex_helloMfc   -   Win32   Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj)   :   error   LNK2001:   unresolved   external   symbol   __endthreadex
nafxcwd.lib(thrdcore.obj)   :   error   LNK2001:   unresolved   external   symbol   __beginthreadex
Debug/Ex_helloMfc.exe   :   fatal   error   LNK1120:   2   unresolved   externals
Error   executing   link.exe.

Ex_helloMfc.exe   -   3   error(s),   0   warning(s)


怎么解决啊?   什么原因呢?

[解决办法]
缺少nafxcwd.lib库,你的程序是怎么生成了?
要是向导的话基本的库应该包含了
[解决办法]
你的工程的运行时库没有用多线程库吧?
看msdn:To use _beginthread or _beginthreadex, the application must link with one of the multithreaded C run-time libraries.

热点排行
Bad Request.