# V8001 missing_entry_point

URL: /docs/errors/V8001
Markdown: /docs/errors/V8001.md

> sakura run needs pub fn main() -> Unit ! {…} in the program it runs (design §9).

An error from the `package` phase. `sakura explain V8001` prints this explanation offline.

`sakura run` needs `pub fn main() -> Unit ! {…}` in the program it runs (design §9).

Fixed:

```sakura
pub fn main() -> Unit ! {Console} { Console.print("hello") }
```

## Wrong program [#wrong-program]

[`compiler/tests/ui/V8001_missing_entry_point.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V8001_missing_entry_point.sakura), which the compiler's ui suite runs through `sakura run`:

```sakura
fn helper() -> Int { 1 }
```

`sakura run` reports `V8001`.

## Fixed program [#fixed-program]

[`compiler/tests/ui/V8001_missing_entry_point.fixed.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V8001_missing_entry_point.fixed.sakura), which `sakura run` accepts with no diagnostics:

```sakura
fn helper() -> Int { 1 }

pub fn main() -> Unit ! {Console} { Console.print("{helper()}") }
```
