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

Windows: `stack exec foo` works, foo.exe does not #425

Closed
rubenmoor opened this Issue Jun 26, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@rubenmoor
Contributor

rubenmoor commented Jun 26, 2015

On windows stack build and stack exec foo works (which is great, btw). My program is running.

However, after stack install the execution of the executable file fails.

.\foo.exe -> complaint about missing library "libstdc++-6.dll"

I have no understanding of what stack exec does in windows (magic?). Any hint to what's going on?

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 26, 2015

Most likely Windows is not able to find the necessary C++ libraries from the standard prompt because they're not on your PATH. stack exec works because it's modifying the PATH to include extra things. Options here would be:

  • Copy the relevant .dll files to something on your PATH
  • Modify your PATH to include extra directories

In theory, stack could copy some DLLs over to the output directory for you, but that seems out-of-scope for what it's doing.

@snoyberg snoyberg added this to the 0.2.0.0 milestone Jun 26, 2015

@rubenmoor

This comment has been minimized.

Contributor

rubenmoor commented Jun 26, 2015

Cool, thanks. I assume these libraries are created by stack during stack build. Where are they stored, i.e. what directories to include in my PATH?

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 26, 2015

Actually, they're not, they're shipped with GHC (and, theoretically in some cases, MSYS). The easiest way to find them is stack exec which. On my system, for instance:

>stack exec which libstdc++-6.dll
/c/Users/Michael/AppData/Local/Programs/stack/i386-windows/ghc-7.8.4/mingw/bin/libstdc++-6.dll
@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 26, 2015

If that turns out to resolve it for you, would you be able to add a FAQ entry on the Wiki about this?

@radix

This comment has been minimized.

Contributor

radix commented Jun 26, 2015

perhaps an idea for a future plugin: bundle up a self-contained windows executable or installer?

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 26, 2015

Sounds like what we're doing with docker. Mind opening as a separate issue?
I don't want to lose track of it.

On Fri, Jun 26, 2015, 6:28 PM Christopher Armstrong <
notifications@github.com> wrote:

perhaps an idea for a future plugin: bundle up a self-contained windows
executable or installer?


Reply to this email directly or view it on GitHub
#425 (comment)
.

@rubenmoor

This comment has been minimized.

Contributor

rubenmoor commented Jun 28, 2015

If that turns out to resolve it for you, would you be able to add a FAQ entry on the Wiki about this?

Done

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 28, 2015

Thanks!

@snoyberg snoyberg closed this Jun 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment