不知道为什么,我用的是VS2005的版本,编译时发生错误,换了台机子也还是出现这种情况
d:\install\vc2005\vc\atlmfc\include\afx.h(24) : fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]请高手指教

解决方案 »

  1.   

    编译,选项,常规,mfc库的时候选择dll
      

  2.   

    贴代码确认你用的MFC建立的工程?
      

  3.   

     requires MFC shared dll version
    要选择MFC共享类库
      

  4.   

    我建的项目是一个win32的项目,都是照书上的做的,难道是我哪的设置出错了吗,应该到哪改呢?
      

  5.   

    代码如下:
    #include<afxwin.h>
    class MyFrameWindow :public CFrameWnd
    {
    public:
    afx_msg void OnPaint()
    {
    CPaintDC paintDC(this);
    paintDC.TextOut(0,0,"this is my first window");
    }
    DECLARE_MESSAGE _MAP()
    };BEGIN_MESSAGE_MAP(MyFrameWindow,CFrmaeWnd)
    ON_WM_PAINT()
    END_MESSAGE_MAP()
    class HelloApp :public CWinApp
    {
    public :
    HelloApp() :CWinApp("my the frist window")
    { }
        BOOL InitInstance()
       {
        CFrameWnd *MyFrame =new MyFrameWindow;
        m_pMainwWnd=MyFrame;
        MyFrame->Create(NULL,(LPCTSTR)"Hello");
        MyFrame->ShowWindow(SW_SHOW);
        return TRUE;
       }
    }HelloWorld;
      

  6.   

    #include <afxwin.h>
    class MyFrameWindow :public CFrameWnd
    {
    public:
    afx_msg void OnPaint()
    {
    CPaintDC paintDC(this);
    paintDC.TextOut(0,0,"this is my first window");
    }
    DECLARE_MESSAGE _MAP()
    };
    BEGIN_MESSAGE_MAP(MyFrameWindow,CFrameWnd)
    ON_WM_PAINT()
    END_MESSAGE_MAP()
    class HelloApp :public CWinApp
    {
    public :
    HelloApp() :CWinApp("my the frist window")
    {}BOOL InitInstance()
    {
      CFrameWnd *MyFrame =new MyFrameWindow;
      m_pMainwWnd=MyFrame;
      MyFrame->Create(NULL,(LPCTSTR)"Hello");
      MyFrame->ShowWindow(SW_SHOW);
        return TRUE;
    }
    }HelloWorld; 
      

  7.   

    BEGIN_MESSAGE_MAP(MyFrameWindow,CFrameWnd)
    ON_WM_PAINT()
    END_MESSAGE_MAP()
      

  8.   

    建工程的时候要选中 MFC ;;