Linking...
hello.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMainFrame::classCMainFrame" (?classCMainFrame@CMainFrame@@2UCRuntimeClass@@B)
Debug/hello.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
运行时出错,不理解。

解决方案 »

  1.   

    #include "stdafx.h"
    #include "hello.h"
    #include "MainFrm.h"
    #include "helloDoc.h"
    #include "helloView.h"void CMainFrame::OnFileHello()
    {
    CHelloDlg dlgHello;
    if(dlgHello.DoModal()==IDOK)
    AfxMessageBox("OK button pressed");
    else
    AfxMessageBox("Cancel button pressed");
    }在MainFrm.cpp中
    其他用向导生成的,久加了一个对话框,和在菜单中让他弹出以对话框
      

  2.   

    是不是你的源文件里少了IMPLEMENT_DYNAMIC(CMainFrame,CFrameWnd)或IMPLEMENT_DYNCREATE(CMainFrame,CFrameWnd)之类的
      

  3.   

    有可能是头文件的顺序问题!你把MainFrm.h放的最后试一下
      

  4.   

    同样楼上的 重新生存一个空的工程 看看有没有类似的问题 如果没有 最好检查一下你的“stdafx.h”
      

  5.   

    同意olivia2046(迷惘的白羊座)
    少了IMPLEMENT_DYNAMIC(CMainFrame,CFrameWnd)