Thread: unresolved externals

  1. #1
    Shadow12345
    Guest

    unresolved externals

    this is a simple program copied from a book, it compiles fine
    #include <afxwin.h> //used for the class library
    //the class CWinApp is fundamental to any Windows program written using MFC
    class COurApp: public CWinApp
    {
    public:
    virtual BOOL InitInstance(); //defined as a virtual function so you know it is from the base class and not a new one being
    //created in the derived class
    };


    //m_pszAppName member, pointer to a string which defines the name of the application
    //m_nCmdShow specifies how the application windows is to be shown when the application starts up

    class COurWnd: public CFrameWnd //Window class
    {
    public:
    COurWnd()
    {
    Create(0, "Our Dumb MFC Application"); //has more parameters than this
    }
    };
    //the 0 means that we want to use the base class default attribues for the window

    BOOL COurApp::InitInstance(void)
    {
    m_pMainWnd = new COurWnd;
    m_pMainWnd->ShowWindow(m_nCmdShow);
    return TRUE;
    }

    COurApp AnApplication;

    when I go to build I get these messages and it will not work:
    Compiling...
    main.cpp
    Linking...
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
    Debug/ivorhorton.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    I am so totally lost it isn't funny.

  2. #2
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    Check that your project settings are for a multi-threaded app. It appears as though you might be compiling as a single threaded app.

    Project->Settings (alt-F7)
    Click the C/C++ Tab and select Code Generation from the Category menu.
    Check the Use run-time Library.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. Unresolved Externals
    By nickname_changed in forum C++ Programming
    Replies: 10
    Last Post: 08-31-2003, 06:13 PM
  5. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM