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

Should --app:gui ensure linking to user32 on Windows? #3203

Closed
skyfex opened this issue Aug 12, 2015 · 7 comments
Closed

Should --app:gui ensure linking to user32 on Windows? #3203

skyfex opened this issue Aug 12, 2015 · 7 comments

Comments

@skyfex
Copy link
Contributor

skyfex commented Aug 12, 2015

To build a GUI app on Windows using VCC, it seems we have to do:

nim c --app:gui --passL:user32.lib

This actually took me a bit of time to find out. Should the Nim compiler perhaps add user32.lib by default when the --app:gui flag is set?

@Araq
Copy link
Member

Araq commented Aug 13, 2015

yeah.

@Leu-Gim
Copy link
Contributor

Leu-Gim commented Feb 14, 2016

Is it needed for programs using --app:gui just to suppress console window (servers, etc.)?

@skyfex
Copy link
Contributor Author

skyfex commented Feb 20, 2016

Leu-Gim: No, I don't believe it is. So that might be a valid use case. But the switch seems to apply that it's meant for gui apps. Maybe a different switch could be used for apps that just want to be invisible.

@Varriount
Copy link
Contributor

This is only for VCC, right? Is there something that has to be done for GCC, Intel, etc?

@dom96
Copy link
Contributor

dom96 commented Jun 6, 2016

Is this really an installation issue?

@clarkeaa
Copy link

To help other people find this issue I'll describe how I found this issue:

If you forget to add --app:gui then when running your exe an extra console window gets brought up with your GUI window.

If you add --app:gui but leave out the linker argument, you get the following linker error:

... stdlib_system.nim.cpp.obj : error LNK2019: unresolved external symbol __imp_MessageBoxA referenced in function "void __cdecl writeToStdErr__a2kDfqdSc1eYf0ZCWOGinQ(char *)" (?writeToStdErr__a2kDfqdSc1eYf0ZCWOGinQ@@YAXPEAD@Z)

@ringabout
Copy link
Member

The issues seem to be fixed by #14013

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

No branches or pull requests

7 participants