oss门户:C++ MFC 高手帮忙看看~!

来源:百度文库 编辑:高校问答 时间:2024/05/06 17:18:50
#include <afxwin.h>

class CHelloFrame : public CFrameWnd
{
public:
CHelloFrame()
{
Create(NULL, "Hello World!", WS_OVERLAPPEDWINDOW, rectDefault);
}
};

class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};

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

CHelloApp HelloApp;

以上代码编译通过,联编出现问题
提示如下:
--------------------Configuration: Hello - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/Hello.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Hello.exe - 3 error(s), 0 warning(s)
我是刚刚开始学习MFC的,请哪位高手帮忙看看是什么问题,应该如何解决?在下感激不尽!谢谢啊!
加入了#include <process.h>可是问题依旧啊~!
--------------------Configuration: MyHello - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/MyHello.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

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

#include <process.h>
那就是工程没有设置好参数
再试试:
[Project] --> [Settings] --> 选择"C/C++"属性页,
在Category中选择Code Generation,
再在Use run-time library中选择Debug Multithreaded或者multithreaded