Site-www: 'Get started: command-line and server apps' page issue

Created on 19 May 2020  路  5Comments  路  Source: dart-lang/site-www

Page URL: https://dart.dev/tutorials/server/get-started
Page source: https://github.com/dart-lang/site-www/tree/master/src/_tutorials/server/get-started.md

Description of issue:
In Compile for production are the given instructions specific to Mac/linux OS ?
On Windows the compiled app wasn't executable until extension of the app was specified as .exe .

This was initial attempt:

PS E:\vscode-workspace\dart-commandl-ine\cli> dart2native .\bin\main.dart -o .\bin\my_native_compiled_app
There was no error thrown for dart2native command.
This resulted in my_native_compiled_app of type file on windows.
Generated: e:\vscode-workspace\dart-commandl-ine\cli\bin\my_native_compiled_app
Trying to execute this generated file gave error:
FullyQualifiedErrorId : NativeCommandFailed

In second attempt added .exe extension as:

PS E:\vscode-workspace\dart-commandl-ine\cli> dart2native .\bin\main.dart -o .\bin\my_native_compiled_app.exe
Executable got generated without errors.
Generated: e:\vscode-workspace\dart-commandl-ine\cli\bin\my_native_compiled_app.exe
No errors were thrown while running
PS E:\vscode-workspace\dart-commandl-ine\cli> .\bin\my_native_compiled_app
output:
Hello world: 21!

bug needs-info

All 5 comments

@kevmoo or @mit-mit do you know the answer to this?

@mit-mit ?

Yes, .exe would be the appropriate extension on Windows. If you omit the -o flag, I believe it does that by default.

Thank you @mit-mit ,
Tried without -o flag
PS E:\vscode-workspace\dart-commandl-ine\cli> dart2native .\bin\main.dart --verbose
Generating AOT kernel dill.
Generating AOT snapshot.
Generating executable.
Generated: e:\vscode-workspace\dart-commandl-ine\cli\bin\main.exe

Executable was generated with the default name _main.exe_ from main.dart
Couldn't find flag to set the name of executable on dart2native.

@kwalrath I suggest we remove the -o part from this page

Was this page helpful?
0 / 5 - 0 ratings