0

please help me with this
i run a borland c++ 5.02, when i try to run this piece of code

#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{

    MessageBox(NULL, "\tHello World!", "My first windows app", NULL);
    return 0;
}

i am getting an unresolved external __ main.. What does this mean and how do i make this code work???
Thanx for ur help

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Fbody
1

Borland is pretty old, I've never used it, so I can't give you specifics. But it looks like your project isn't configured correctly for a Windows API program. You'll have to look through your project's configuration to find the setting that tells the compiler the name of your program's entry point and change it to WinMain().

Since it's for Windows, you may want to consider upgrading to a Visual Studio product. Not only will it make it easier for you to create WinAPI programs, the code will be more up-to-date.

Edited by Fbody: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.