• Advertisement

Archived

This topic is now archived and is closed to further replies.

having a problem with some code from a book, can you help me please

This topic is 5495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello all i''m new here i recently bought the book windows game programming for dummies second edition by Andre Lamothe on chapter 3 it gives me this code to write in and compile, it then explains it. this is the code // PROG3_2.CPP - A simple message box #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> // main entry point for all windows programs int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) { // call message box api MessageBox(NULL, "What''s up world!", "My First Windows Program",MB_OK); // exit program return(0); } // end WinMain anyway - when i compile there is no problem, its when i run the program i get this message from visual c++ 6.0i Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/PROG3_2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. PROG3_2.exe - 2 error(s), 0 warning(s) can anyone help me please. I dont want to give up and feel I have wasted £20 on a book thats useless thanks a lot

Share this post


Link to post
Share on other sites
Advertisement
Are you using Microsoft Visual C++? If you are, when you create the workspace for your application, choose Win32 Application instead of Console Application. I think that will solve your problem.

Share this post


Link to post
Share on other sites

  • Advertisement