Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help a beginner with unresolved error problem (windows prog)

Status
Not open for further replies.

Skywise

Programmer
Apr 11, 2001
9
US
Ok, I have searched and read the posts about running a windows program using borlands c++ (I use version 5.02). The post are a little beyond me... Here is my program:
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>

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

Can someone in an easy to understand way explain how to fix the linker problem, because I keep getting &quot;unresolved _main &quot; in cox32 or something... I would LOVE it if you could explain in full how to fix this... (ps: I am new to C++ lang, but I am not a computer moron). Thanks.
 
You must create at the first a Win32 type project. Afetr it add your .cpp to your project. If you create the file at the first, the compiller add it on a project what by default is a console application project(typical DOS program) whose main function is not WinMain bu main John Fill
ivfmd@mail.md
 
I believe the defaults for 5.02 were for either DOS or Windows Console. If you want to compile in Win32 you will need to change your switches on the compiler commands. James P. Cottingham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top