Could not find module ‘Prelude’ Perhaps you haven't installed the "p_dyn" libraries for package ‘base-4.18.0.0’? Use -v (or `:set -v` in ghci) to see a list of the files searched for.
> ghc -prof -fprof-auto hello.hs
Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default
[1 of 2] Compiling Main ( hello.hs, hello.o )
hello.hs:1:1: error:
Could not find module ‘Prelude’
Perhaps you haven't installed the "p_dyn" libraries for package ‘base-4.18.0.0’?
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
1 | main = print "hello"
| ^
I reported this in 9.2.3 , in #21709. At that time there was a workaround of adding -static but that no longer works. It gives a slightly different error message:main = print "hello"
ghc -prof -fprof-auto -static hello.hs
Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default
[2 of 2] Linking hello
ld: warning: directory not found for option '-L/opt/local/lib/'
ld: library not found for -lHStyp-qlty-1-186ccc78_p
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.6.1: `gcc' failed in phase `Linker'. (Exit code: 1)