Thread: unresolved external reference

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    10

    unresolved external reference

    I am delving into Windows API programming using Borland's compiler.

    When I try to compile sample programmes - for example:

    Code:
    #include <windows.h>
    
    int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
      MessageBox(NULL, "Hello World!", "Message", MB_OK);
      return 0;
    }
    there is an error message

    Error: Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ

    Can anyone advise me what this actually means and how I can set up the compiler to compile Windows programmes?

    Grateful for any help.

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    10

    Problem solved

    I found the answer. You put option -tW in the compiler command line.

    Sorry for taking your time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM