Why can't I compile the -dynamic option?

I start very hard with Haskell and, following the video, I tried the following:

stack ghc -- -dynamic test.hs

The following error message is generated:

test.hs:1:1: error:
    Failed to load interface for `Prelude'
    Perhaps you haven't installed the "dyn" libraries for package `base-4.9.1.0'?
    Use -v to see a list of the files searched for.

I tried using -v as suggested, but that didn't help.

A similar command without -dynamic works fine, but generates a much larger executable:

stack ghc test.hs

Any suggestions on how to fix this?

(This is under Windows 10).

+4
source share

Source: https://habr.com/ru/post/1689495/


All Articles