Search code examples
gitvisual-studio-codemsys2

msys2 git on windows errors looking for shared object file


I am trying to use my msys2 git install (which works 100% from within msys2) from Visual Studio Code, but it errors immediately upon trying. The error I get is:

...msys2/usr/lib/git-core/git-remote-https.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

Has anyone experienced this? Any fix?


Solution

  • Thanks to David Grayson - I was able to get this - The answer is twofold.

    1. Ensure that the directory to wherever your code is (repo) is the same as your msys directory (ie. I had mine in C:/Users/<username>, but mounted at /home/<username> ) So I had to do a mklink from C:/Users/<username>to /home/<username>.

    2. As David said but the git.exe into your windows path. For me that is <basedir>msys2/usr/bin/

    After that everything was working fine.

    This was for visual studio code on windows 10 by the way.

    Thanks -


    Another option is to create a batch file and point Code.exe at the batch file for git; ie git.bat

    @echo off
    @set "PATH==%PATH%;C:\cmder\vendor\msys2\usr\bin;"
    @call "C:\cmder\vendor\msys2\usr\bin\git.exe" %*
    

    I like to keep my system portable, that is the reason for this layout.