Can't link hello world.

This is a discussion on Can't link hello world. within the Windows Programming forums, part of the Platform Specific Boards category; Guys that is code copied from a book (Programming Windows 5th edition): Code: #include <windows.h> int WINAPI WinMain (HINSTANCE hInstance, ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    3

    Can't link hello world.

    Guys that is code copied from a book (Programming Windows 5th edition):

    Code:
    #include <windows.h> 
     
    int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, 
                        PSTR szCmdLine, int iCmdShow) 
    { 
         MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0) ; 
     
         return 0 ; 
    }
    Can't link it with VS2010. What am I doing wrong?

    Error 1 error LNK2001: unresolved external symbol _WinMainCRTStartup
    Thanks.

  2. #2
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    it's probably complaining about the "Windows 98" part

    Seriously: have you defined your project as a Win32 project, CLR project, console project?
    If you choose the wrong project options VS is going to link to a different set of libraries, leading to errors like the one you're getting.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL coordinates
    By Da-Nuka in forum Game Programming
    Replies: 5
    Last Post: 01-10-2005, 10:26 AM
  2. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM
  3. Too much to ask ?
    By deflamol in forum C Programming
    Replies: 2
    Last Post: 05-06-2004, 04:30 PM
  4. Undefined Structure in Link List
    By _Cl0wn_ in forum C Programming
    Replies: 1
    Last Post: 03-22-2003, 04:57 PM
  5. Hello World in Windows
    By FearOfTheDark in forum Windows Programming
    Replies: 2
    Last Post: 01-08-2003, 02:02 PM

Tags for this Thread


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