Thread: simple program not working

  1. #1
    Unregistered
    Guest

    simple program not working

    when I compile this code in MS VC++ 6, I get the following errors:

    Linking...
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/hwwin.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    hwwin.exe - 2 error(s), 0 warning(s)

    what's wrong and what do I have to do to correct this? thanks.

    Code:
    #include <windows.h>
    
    int WINAPI WinMain
     (HINSTANCE hInstance,
      HINSTANCE hPrevInstance,
      PSTR szCmdLine, int iCmdShow)
    {
     return 0;
    }

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    Try changing the PSTR to an LPSTR.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    This is usually (the other 4 or so times I have seen this asked here) about what TYPE of project you started.

    Use a WIN32 app not a WIN32 console app.

    Do a search for more detailed explnation from adrianxw, I'm too lazy to do the search for you.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Blackjack Program
    By saber1357 in forum C Programming
    Replies: 1
    Last Post: 03-28-2009, 03:19 PM
  2. Replies: 10
    Last Post: 09-07-2008, 11:38 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. simple frontend program problem
    By gandalf_bar in forum Linux Programming
    Replies: 16
    Last Post: 04-22-2004, 06:33 AM
  5. unable to get simple program working
    By toom in forum Linux Programming
    Replies: 1
    Last Post: 10-11-2003, 05:05 AM