初学者请问有关问题哈~多谢各位呀~
菜鸟请教问题哈~~~~~~谢谢各位呀~~~~~~~~~~~~
我的程序
#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.
我的程序
#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.