DevRandom
DevRandom

Reputation: 115

Error while compiling using Dev-C++

I'm trying to compile the following code using Dev-C++ on a WinXP machine:

#include <windows.h>

int APIENTRY _tWinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPTSTR    lpCmdLine,
    int       nCmdShow
)
{
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    return 0;
}

I get the following error message;

C:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference to `WinMain@16'

I've search for the error message but I don't understand what's wrong.

Thanks in advance.

PS: I'm a real noob at c++ so sorry if it seems obvious for you guys.

Upvotes: 1

Views: 12304

Answers (1)

Ali Kazmi
Ali Kazmi

Reputation: 1458

try replacing _tWinMain with WinMain.

Upvotes: 5

Related Questions