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,230 points
1,600 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,360 points

Related Questions In Others

+1 vote
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 9, 2020 in Others by Ravibharathi
• 130 points
536 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,360 points
391 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,360 points
2,487 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,360 points
208 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,230 points
357 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,360 points
3,767 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP