having a problem with some code from a book, can you help me please
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
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement