Thread: Can't link hello world.

  1. #1
    Registered User
    Join Date
    Apr 2010

    Can't link hello world.

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

    #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

  2. #2
    Join Date
    Nov 2004
    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, 11: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, 05:57 PM
  5. Hello World in Windows
    By FearOfTheDark in forum Windows Programming
    Replies: 2
    Last Post: 01-08-2003, 03:02 PM

Tags for this Thread