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

bflat happily compiles a program without Main method #185

Closed
ghost opened this issue Feb 27, 2024 · 2 comments
Closed

bflat happily compiles a program without Main method #185

ghost opened this issue Feb 27, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 27, 2024

and that program failed to run. Windows said, This app can't run on your PC. It took me several hours before I figured it out. The program was ported from Java, where the main method is named main, and I forgot to change it to Main. This means the program is without a Main method. It's not until I used Mono's mcs that I realized this because it refused to compile the program and gave a very clear error message about missing a Main method.

@MichalStrehovsky
Copy link
Member

bflat considers things without Main libraries and that's a feature, not a bug. I'll leave this open because the compiler could generate a warning if there's no UnmanagedCallersOnly methods with an entrypoint (the library is a non-sensical library, but it is a library nonetheless).

This app can't run on your PC - the output should have a .dll extension in this case. One needs to go out of their way to rename the file to get this failure mode.

@ghost
Copy link
Author

ghost commented Feb 28, 2024

bflat considers things without Main libraries and that's a feature, not a bug. I'll leave this open because the compiler could generate a warning if there's no UnmanagedCallersOnly methods with an entrypoint (the library is a non-sensical library, but it is a library nonetheless).

This is bflat's weirdness. I will note this. Thank you.

This app can't run on your PC - the output should have a .dll extension in this case. One needs to go out of their way to rename the file to get this failure mode.

Again, this is bflat's weirdness. Only bflat requires me to specify the executable name with extension, otherwise it will output an extension-less file. All other compilers choose the extension for the executable automatically.

This issue was closed.
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

1 participant