# Cannot compile statically : ld: library not found for -lcrt0.o

**URL:** <https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070>\
**Category:** Help & Support\
**Created:** [November 19, 2021, 1:25pm UTC](https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070 "2021-11-19T13:25:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![serge-hulne](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/serge-hulne/32/1211_2.png) [@serge-hulne](https://forum.crystal-lang.org/u/serge-hulne)\
**Post date:** [November 19, 2021, 1:25pm UTC](https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070/1 "2021-11-19T13:25:43Z")

</div>

Hi, I tried to compile a hello world statically on a Mac M1 (Monterey)

Is that a bug or do I have to install a specific library via Brew ?

I installed Crystal using brew:

```auto
brew -v
Homebrew 3.3.4

```

```auto
crystal build test_2.cr --static
ld: library not found for -lcrt0.o (this usually means you need to install the development package for libcrt0.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc "${@}" -o /Users/sergehulne/

```

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [November 19, 2021, 1:51pm UTC](https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070/2 "2021-11-19T13:51:07Z")

</div>

Fully-static linking is not supported on MacOS exactly because such system libraries are not available as static libraries. See [Static Linking - Crystal](https://crystal-lang.org/reference/guides/static_linking.html#macos)

---

<div class="post-metadata">

**Author:** ![serge-hulne](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/serge-hulne/32/1211_2.png) [@serge-hulne](https://forum.crystal-lang.org/u/serge-hulne)\
**Post date:** [November 19, 2021, 1:52pm UTC](https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070/3 "2021-11-19T13:52:58Z")

</div>

Thank you!
