Simple Windows program errors

This is a discussion on Simple Windows program errors within the Windows Programming forums, part of the Platform Specific Boards category; Alright, I read "Lesson One: An Introduction to Windows Programming," and copied and pasted the code (see below) into my ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    31

    Simple Windows program errors

    Alright, I read "Lesson One: An Introduction to Windows Programming," and copied and pasted the code (see below) into my compiler (VC++ 6.0), compiled fine but when built I get the following errors:
    Linking...
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
    The code is just this:
    Code:
    #include <windows.h>
    int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {
     	
    	MessageBox(NULL, "\tHello World!", "My first windows app", NULL);
    	return 0;
    }
    Am I missing something really obvious here?

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    Create a Win32 Project.

    Not a Win32 Console Project.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    31
    Ugh, I knew it was something obvious...Thanks so much!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  2. Replies: 1
    Last Post: 12-30-2007, 10:08 AM
  3. Help with a very simple program
    By htdefiant in forum C++ Programming
    Replies: 13
    Last Post: 08-14-2007, 02:27 PM
  4. simple 2d "putpixel" api for windows?
    By spiky in forum C Programming
    Replies: 2
    Last Post: 10-27-2005, 03:44 PM
  5. Problem with simple XOR program
    By spike_ in forum C++ Programming
    Replies: 8
    Last Post: 08-17-2005, 01:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21