R
Red Hammer
Hi, I am new to using Visual C++ and trying to test it out. This is the
simple program I wrote to test it:
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // the main windows headers
#include <windowsx.h> // a lot of cool macros
// main entry point for all windows programs
int WINAPI WinMain(HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!",
"MY FIRST WINDOWS PROGRAM",
MB_OK | MB_ICONEXCLAMATION);
// exit program
return(0);
} // end WinMain
ok, it will compile no problem but when it comes to linking I get the
following error:
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/demo2_2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I get this error when using either Visual C++ 5.0 or 6.0
the file LIBCD.lib is resident in the lib folder...
Any help much appreciated, Thanks
simple program I wrote to test it:
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // the main windows headers
#include <windowsx.h> // a lot of cool macros
// main entry point for all windows programs
int WINAPI WinMain(HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!",
"MY FIRST WINDOWS PROGRAM",
MB_OK | MB_ICONEXCLAMATION);
// exit program
return(0);
} // end WinMain
ok, it will compile no problem but when it comes to linking I get the
following error:
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/demo2_2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I get this error when using either Visual C++ 5.0 or 6.0
the file LIBCD.lib is resident in the lib folder...
Any help much appreciated, Thanks