Skip to content

Couldn't execute ghc --print-libdir #1907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
z5230445 opened this issue Jun 10, 2021 · 6 comments
Closed

Couldn't execute ghc --print-libdir #1907

z5230445 opened this issue Jun 10, 2021 · 6 comments
Labels
build tool: stack type: support User support tickets, questions, help with setup etc.

Comments

@z5230445
Copy link

Dear all
Im running vscode on windows10.

I have installed the Haskell installer for windows from the official website
(https://docs.haskellstack.org/en/stable/README/#how-to-install)

I have also installed the haskell extension pack on my vscode.

Now im getting an error as shown in the photo. Please help and thank you so very much.
issue

@Ailrun Ailrun added the type: support User support tickets, questions, help with setup etc. label Jun 10, 2021
@Ailrun
Copy link
Member

Ailrun commented Jun 10, 2021

Do you have system GHC installed? If not, you need a stack project (with stack.yaml) in order to use GHC installed by stack.

@z5230445
Copy link
Author

Hi Ailrun
Thanks for the help. I am new to Haskel. Would you please elaborate on " a stack project (with stack.yaml)" ? Thank you so much

@Ailrun
Copy link
Member

Ailrun commented Jun 10, 2021

@z5230445 I assume that your directory does not have any project configuration, i.e., it's just with *.hs files. Without System GHC (installed in your %PATH%), the current HLS does not support such a case. You need either

  • To install a system GHC (using choco package manager or similar)
  • To add a project setting for your directory

For the project setting, you need stack.yaml and one of <your project name>.cabal/package.yaml. You can create those files using stack new command with a template (listed here), or you can create package.yaml by hand based on info in https://github.com/sol/hpack and then use stack init.

@z5230445
Copy link
Author

Thank you so much.

@jneira
Copy link
Member

jneira commented Jun 10, 2021

I assume that your directory does not have any project configuration, i.e., it's just with *.hs files. Without System GHC (installed in your %PATH%), the current HLS does not support such a case.

For completeness the issue tracking support for this case is: #692

@z5230445
Copy link
Author

problem solved thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack type: support User support tickets, questions, help with setup etc.
Projects
None yet
Development

No branches or pull requests

3 participants