AFAIK HINSTANCE is defined through(ref: Microsoft document):
typedef PVOID HANDLE;
typedef HANDLE HINSTANCE;
But why I can’t use PVOID when defining _tWinMain
?
int WINAPI
_tWinMain (PVOID hInstance, PVOID hPrevInstance, PTSTR pCmdLine, int nShowCmd)
gcc says:
error: conflicting types for 'WinMain'; have 'int(void *, void *, CHAR *, int)' {aka 'int(void *, void *, char *, int)'}
64 | _tWinMain (PVOID hInstance, PVOID hPrevInstance, PTSTR pCmdLine, int nShowCmd)
| ^~~~~~~~~
mingw64x86_64-w64-mingw32includewinbase.h:1111:14: note: previous declaration of 'WinMain' with type 'int(struct HINSTANCE__ *, struct HINSTANCE__ *, CHAR *, int)' {aka 'int(struct
HINSTANCE__ *, struct HINSTANCE__ *, char *, int)'}
1111 | int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
| ^~~~~~~
I’m using mingw from winlibs 11.2 in Windows 10(64 bit).
FYI, in my mingw64x86_64-w64-mingw32includewtypes.h
of winlibs:
typedef void *HINSTANCE;