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,260 points
3,593 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,460 points

Related Questions In Others

0 votes
1 answer

'Microsoft.Office.Interop.Excel.Range' does not contain a definition for 'get_Default'

You are using C# version 4, the ...READ MORE

answered Oct 16, 2022 in Others by narikkadan
• 63,600 points
2,247 views
0 votes
1 answer

A button in excel sheet does not work for the first time

When you press the Display button, the ...READ MORE

answered Mar 30, 2023 in Others by narikkadan
• 63,600 points
511 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,460 points
1,149 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,460 points
4,151 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,460 points
765 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,260 points
1,182 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,460 points
5,142 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP