Simpel WIN32 Message box



Hi, i got a problem.
I've got VS2005 Beta 1 installed, and the newest platform SDK.
I'm a newbie in the WIN32 Programming. but if i try to compile this piece of
code:

#define WIN32_LEAN_AND_MEAN
#include <windows.h> // the main windows headers
#include <windowsx.h> // a lot of cool macros

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR
lpcmdline, int ncmdshow)
{
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!", "MY FIRST WINDOWS PROGRAM",
MB_OK | MB_ICONEXCLAMATION);
return(0);
}

The compiller gives this error back:

Linking...
main.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16
referenced in function _WinMain@16
Debug/Game_02.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Administrator\Mijn
documenten\Visual Studio\Projects\Game_02\Game_02\Debug\BuildLog.htm"
Game_02 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Anyone knows how to solve this problem? I really like the compilers GUI, and
i want to learn on this compiler :)
.



Relevant Pages

  • Re: vcvars32.bat not present after installing the Microsoft .NET SDK
    ... > I am new to C++ and am trying to set up my machine to compile from the ... > HINSTANCE hprevinstance, ... Copyright Microsoft Corporation 1984-2002. ... > the Platform SDK. ...
    (microsoft.public.vc.language)
  • Re: Windows App - C++
    ... > Because you forgot to compile and run the program? ... > newsgroup. ... >> int WINAPI WinMain(HINSTANCE hInstance, ... > Don't use C style casts. ...
    (comp.lang.cpp)