OrangeC
OrangeC copied to clipboard
Error: Undefined External 'WinMain' in module c0pe.nas
Very simple program:
#include <windows.h>
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PWSTR szCmdLine, int CmdShow) {
MessageBoxW(NULL, szCmdLine, L"Title", MB_OK);
return 0;
}
Tried with both occ /Wg and gccocc -mwindows.
hm i'll have to work on this do we need a wmain() too?
Change the code to this and it will compile:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR szCmdLine, int CmdShow) {
MessageBoxW(NULL, szCmdLine, L"Title", MB_OK);
return 0;
}
According to https://learn.microsoft.com/windows/win32/learnwin32/winmain--the-application-entry-point the only thing to add is looking for either of both, preferably wWinain - not sure how to achieve this, though.
we don't quite do linking the same way as microsoft... so... without a rewrite this isn't likely to happen without additional compiler switches. I may consider a rewrite later, not right now though....