Dart LoadScriptFromKernel The binary program does not contain main

0 votes

Hi Guys,

I have one simple script in dart language. But when I try to run this script, it shows me the below error.

func() {
  print("Name: Nadeem");
}

$ dart hello.dart
Dart_LoadScriptFromKernel: The binary program does not contain 'main'.

How can I solve this error?

Jul 21, 2020 in Others by akhtar
• 38,170 points
391 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to add the main() function in your code. Dart will execute the main() function. So you have to call your function inside the main() function.

answered Jul 21, 2020 by MD
• 95,040 points

Related Questions In Others

0 votes
0 answers

I am not able to see the chat box on webinar-session. i can see only ask question pane

Today (8/aug/2020) I have joined one webinar, ...READ MORE

Aug 8, 2020 in Others by Ravibharathi
• 120 points
185 views
0 votes
1 answer

How to place the children along the main axis in Flutter?

Hi@akhtar, If you are created the App with ...READ MORE

answered Sep 8, 2020 in Others by MD
• 95,040 points
43 views
0 votes
1 answer

How to install Dart in Windows system?

Hi@akhtar, Dart is the programming language used to code Flutter apps. ...READ MORE

answered Jul 21, 2020 in Others by MD
• 95,040 points
194 views
0 votes
1 answer

flutter run: No connected devices

Hi@akhtar, To prepare to run and test your ...READ MORE

answered Jul 21, 2020 in Others by MD
• 95,040 points
999 views
0 votes
1 answer

How to create a function in Dart language?

Hi@akhtar, There are many function types available in ...READ MORE

answered Jul 22, 2020 in Others by MD
• 95,040 points
90 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,170 points
136 views
0 votes
1 answer

Flutter Error: MediaQuery.of() called with a context that does not contain a MediaQuery.

Hi@akhtar, You need a MaterialApp or a WidgetsApp around your widget. They ...READ MORE

answered Aug 27, 2020 in Others by MD
• 95,040 points
2,560 views