Thread: Simple Program wont execute after compiles w. no errors

  1. #1
    Unregistered
    Guest

    Simple Program wont execute after compiles w. no errors

    What is wrong w. this.

    Here is the source.


    #include <afxwin.h>

    class CMainWin : public CFrameWnd
    {
    public:
    CMainWin();
    DECLARE_MESSAGE_MAP()
    };


    CMainWin::CMainWin()
    {
    Create(NULL,"Blah blah blah");
    }

    class CApp : public CWinApp
    {
    public:
    BOOL InitInstance();
    };

    BOOL CApp::InitInstance()
    {
    m_pMainWnd = new CMainWin;
    m_pMainWnd->ShowWindow(m_nCmdShow);
    m_pMainWnd->UpdateWindow();

    return TRUE;
    }

    BEGIN_MESSAGE_MAP(CMainWin, CFrameWnd)
    END_MESSAGE_MAP()

    CApp App;



    It compiles fine, but cant execute.
    Here is the error in vs6

    --------------------Configuration: lame - Win32 Debug--------------------
    Linking...
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
    Debug/lame.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

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

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Go to Project/Settings - General tab, and select either Using MFC in a Shared DLL or Using MFC in a Static Library.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program giving errors
    By andy bee in forum C Programming
    Replies: 5
    Last Post: 08-11-2010, 10:38 PM
  2. Help with a very simple program
    By htdefiant in forum C++ Programming
    Replies: 13
    Last Post: 08-14-2007, 01:27 PM
  3. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  4. Execute from another program using C#
    By Grayson_Peddie in forum C# Programming
    Replies: 4
    Last Post: 05-04-2003, 12:03 PM
  5. Linker errors with simple static library
    By Dang in forum Windows Programming
    Replies: 5
    Last Post: 09-08-2001, 09:38 AM