//hello world
#include <afxwin.h>
#include "H.h"CMyApp myApp;BOOL CMyApp::InitInstance ()
{
    m_pMainWnd = new CMainWindow;
    m_pMainWnd->ShowWindow (m_nCmdShow);
    m_pMainWnd->UpdateWindow ();
    return TRUE;
}
/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functionsBEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
    ON_WM_PAINT ()
END_MESSAGE_MAP ()CMainWindow::CMainWindow ()
{
    Create (NULL, _T ("The Hello Application"));
}void CMainWindow::OnPaint ()
{
    CPaintDC dc (this);
    
    CRect rect;
    GetClientRect (&rect);    dc.DrawText (_T ("Hello, MFC"), -1, &rect,
        DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}class CMyApp : public CWinApp
{
public:
    virtual BOOL InitInstance ();
};
/////////////////////////////////////////////////////////////////////////
// CMyApp member functions
class CMainWindow : public CFrameWnd
{
public:
    CMainWindow ();protected:
    afx_msg void OnPaint ();
    DECLARE_MESSAGE_MAP ()
};test7 error LNK2019: 无法解析的外部符号 __endthreadex ,该符号在函数 "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z) 中被引用
test7 error LNK2019: 无法解析的外部符号 __beginthreadex ,该符号在函数 "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z) 中被引用
test7 fatal error LNK1120: 2 个无法解析的外部命令
为什么啊,

解决方案 »

  1.   

    多线程支持
    alt+f7 -> c/c++ -> code generation -> code generation -> debug multithreaded...
      

  2.   

    project--setting--general MFC设置改为Use MFC in a Shared DLL
      

  3.   

    你在 project--setting--general MFC设置里用的默认设置 no using mfc,改一下就行了:)
      

  4.   

    可是改了之后,还是有如下错误
    libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/h.exe : fatal error LNK1120: 1 unresolved externals
    为什么啊?
      

  5.   

    Project->Settings-Link 最下面的 Project Option
    将里面的/subsystem:console 改成/subsystem:windows