Archived

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

Program example from book doesnt work...

This topic is 5274 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

Im reading "Tricks of the game programming gurus" or whatever it''s called, and the first example has thrown me for a loop. I put it in verbatim and it doesn''t work at all. Here is the code sample: ----------------------------------- #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) { MessageBox(NULL,"There can only be one!","My first windows program",MB_OK | MB_ICONEXCLAMATION); return (0); } ------------------------------------- I get two errors after trying to build this: -------------------------------------------- --------------------Configuration: Cpp3 - Win32 Debug-------------------- Compiling... Cpp3.cpp Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Cpp3.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Cpp3.exe - 2 error(s), 0 warning(s) ---------------------------------------------------------------- Im using MSVC++ 6.0. What could the problem possibly be? I cant think of a decent signature right now...try back later...MUCH later.

Share this post


Link to post
Share on other sites
yup...i had the exact opposite problem a while back for my first console app...im a smart one...tried to do win32 app and got the wierdest errors ever..but anyways...go with wut he said

Share this post


Link to post
Share on other sites