Skip to content

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

Closed

Description

@rubenmoor

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?

Activity

  1. snoyberg commented on Jun 26, 2015

    @snoyberg
    Contributor

    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.

  2. added this to the milestone on Jun 26, 2015
  3. rubenmoor commented on Jun 26, 2015

    @rubenmoor
    ContributorAuthor

    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?

  4. snoyberg commented on Jun 26, 2015

    @snoyberg
    Contributor

    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
    
  5. snoyberg commented on Jun 26, 2015

    @snoyberg
    Contributor

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

  6. radix commented on Jun 26, 2015

    @radix
    Contributor

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

  7. snoyberg commented on Jun 26, 2015

    @snoyberg
    Contributor

    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)
    .

  8. rubenmoor commented on Jun 28, 2015

    @rubenmoor
    ContributorAuthor

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

    Done

  9. snoyberg commented on Jun 28, 2015

    @snoyberg
    Contributor

    Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions