# Haskell Stack - can't compile with -dynamic

**URL:** <https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409>\
**Category:** Learn\
**Created:** [September 13, 2020, 8:00pm UTC](https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409 "2020-09-13T20:00:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilshibaybay](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@lilshibaybay](https://discourse.haskell.org/u/lilshibaybay)\
**Post date:** [September 13, 2020, 8:00pm UTC](https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409/1 "2020-09-13T20:00:57Z")

</div>

Sorry for the newbie question. I’m trying to follow an online course and learn Haskell. Having difficulty with compiling even hello-world apps if I use the -dynamic flag. Works fine without -dynamic. I think the key error is:

**Perhaps you haven’t installed the “dyn” libraries for package `base-4.13.0.0’?**

I’ve tried uninstalling/reinstalling Stack a number of times, and various attempts to download GHC in other ways, with no luck.

Windows10  
Stack 2.3.3

 ![Stack dynamic err screenshot](https://us1.discourse-cdn.com/flex002/uploads/haskell/original/1X/1c274e3b4a11328e32874afbd11bbe9677f3204c.png)

---

<div class="post-metadata">

**Author:** ![jaspervdj](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/jaspervdj/32/586_2.png) [@jaspervdj](https://discourse.haskell.org/u/jaspervdj)\
**Post date:** [September 15, 2020, 9:27am UTC](https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409/2 "2020-09-15T09:27:53Z")

</div>

Unfortunately, [dynamic linking on windows is currently not supported](https://gitlab.haskell.org/ghc/ghc/-/wikis/windows-dynamic-linking). Is there any reason why this is required for your project? Maybe there are alternative solutions.

---

<div class="post-metadata">

**Author:** ![lilshibaybay](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@lilshibaybay](https://discourse.haskell.org/u/lilshibaybay)\
**Post date:** [September 17, 2020, 12:57am UTC](https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409/3 "2020-09-17T00:57:21Z")

</div>

Thank you. There’s no particular reason I need it, except the instructor of the course keeps mentioning that it is important and best practice to avoid compiling large executables. I was just frustrated I couldn’t follow along. Thanks again.

---

<div class="post-metadata">

**Author:** ![bradrn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bradrn/32/264_2.png) [@bradrn](https://discourse.haskell.org/u/bradrn)\
**Post date:** [September 23, 2020, 8:37am UTC](https://discourse.haskell.org/t/haskell-stack-cant-compile-with-dynamic/1409/4 "2020-09-23T08:37:15Z")

</div>

> the instructor of the course keeps mentioning that it is important and best practice to avoid compiling large executables

Strange advice… I can accept that it would reduce executable size, but I have never seen `-dynamic` being recommended as ‘best practice’. (And, as you can see, `-dynamic` isn’t even particularly well-supported!)
