Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Undefined External 'WinMain' in module c0pe.nas #971

Open
ghost opened this issue Oct 17, 2023 · 4 comments
Open

Error: Undefined External 'WinMain' in module c0pe.nas #971

ghost opened this issue Oct 17, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 17, 2023

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.

@LADSoft
Copy link
Owner

LADSoft commented Oct 19, 2023

hm i'll have to work on this do we need a wmain() too?

@ghost
Copy link

ghost commented Nov 12, 2023

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;
}

@GitMensch
Copy link
Contributor

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.

@LADSoft
Copy link
Owner

LADSoft commented Feb 9, 2024

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....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants