Git for Windows – The Program can't start because libiconv2.dll is missing

When I attempt to run certain commands (like git push, for example) from a git Bash on Windows 7 (64bit) I get the error:

The program can't start because libiconv2.dll is missing from your computer

I have searched exhaustively for a solution to this.
The most I can find is an issue thread at the google code site (Issue 419) and a few other blogs here and there. As far as I can tell none of the suggestions offered in the posts will actually solve my issue.

  • git hook script output is added with annoying “[K” postfix
  • GIt Config Alias With Quotes and Pipes via Command Line
  • GraphLab Create Launcher installation error
  • Git bash-completion with filename support?
  • What is in your .gitignore when you use Spring Roo?
  • Azure “KuduSync.NET” error using git deployment in multiple azure websites
  • I have tried re-installing. I have tried adding $GIT/bin to the PATH.
    I can verify that the dll is in the $GIT/bin directory…but still I cannot push to remote.

    I have a working install of msysgit on another Windows 7 box, and I installed the same way in both situations… so needless to say I am quite confused.

    Any help on this would be most appreciated.

    Thanks,

  • Git stash - Cannot apply stash back to my branch
  • Can't view Heroku logs - Cannot read property 'run' of undefined
  • fatal: ambiguous argument 'origin': unknown revision or path not in the working tree
  • How to do a 'git log' in the Windows Git Gui?
  • git multiple repository management
  • How to fix GITHUB commit date?
  • 25 Solutions collect form web for “Git for Windows – The Program can't start because libiconv2.dll is missing”

    Work around from this thread: http://groups.google.com/forum/#!topic/msysgit/twrVn_EbNI4

    • cd into your git install directory
    • copy mingw\bin\libiconv-2.dll libexec\git-core
      (or copy bin\libiconv-2.dll libexec\git-core if your installation has no mingw folder)

    In the linked thread Drew asks for assistance, so if you think you can help fix it you might want to reply in that Google Groups thread.

    Error happens with these builds:

    • msysgit-fullinstall-1.7.4 OR 1.7.6 (and 1.7.7)
    • msysgit-netinstall-1.7.4 OR 1.7.6 (and 1.7.7)
    • Git For Windows 1.7.6 (but not 1.7.4)
    • copy /Program Files/Git/bin/libiconv-2.dll
    • to /Program Files/Git/libexec/git-core/

    I have resolved this…there are a couple of things to note here.

    1) The problem was a typo in my configured origin in my local .git/config file…So I’m an idiot.

    2) Git Bash does not fail gracefully in this situation, and then throws this very misleading error as an alert, rather than reporting that there is no configured origin of the name specified in the .git/config file.

    The only way I was able to figure this out was by adding the $GitPath/cmd directory
    to my path and running git from the command line. There, I was able to get a verbose error message indicating that the remote repository did not yet exists. Then I pulled up the trusty vi editor and saw there was in fact a typo.

    The lesson here. If you are getting a weird .dll error with msysgit, it could very likely be the result of a misconfiguration…rather than some system anomaly or install issue.

    Thanks to everyone who tried to help with this!

    I saw this error with msysGit-fullinstall-1.7.3.1-preview20101002.exe on Win 7.

    Added <msysgit_dir>\mingw\bin to PATH 
    

    fix it.
    libiconv2.dll was found in that directory.

    Variation of sqzaman’s answer, as I did not have the folders in the same place they did:

    Copy
    %USERPROFILE%\Local Settings\Application Data\GitHub\PortableGit_*\bin\*.dll
    to
    %USERPROFILE%\Local Settings\Application Data\GitHub\PortableGit_*\libexec\git-core
    

    Note that I started by copying libiconv-2.dll, but then it complained about libcurl.dll so I went ahead and copied *.dll

    Fastest way to fix this is locating the *.dll file on the other pc and copy it =)

    I just tried installing SmartGIT on Windows and facing the same problem. I just figure out that it works not by pointing it to git.exe, instead I pointed it to C:\msysgit\cmd\git.cmd. So far it works just fine. I can access the git repository under msysgit.

    FYI, I’m using the Net installer for Windows.

    Hoping that this is the right approach.

    To resolve this issue I actually had to copy all DLLs from mingw/bin/ to bin/ (not overwriting any existing once). I use remote HTTPs repositories and it just kept on complaining.

    As SmartGit references this page of stackoverflow in error result i think this knowledge might be useful for someone here….

    Sometimes although there is no problem with git installation. Even if you can use git bash and get version information by typing

    git -- version 
    

    SmartGit doesn’t add repository and returns git is obsolote or version information is cannot be fetched (or similar to this message)…

    If so, you’d better check your security utilities and virus removal applications settings first. In my situation disabling comodo firewall make smartgit able to see healty git installation and version information.

    I have msysgit on Windows7 without any issue with any DLL.

    I have libiconv2.dll in the bin directory: C:\Path\To\Git\1.7.1\bin

    The issue 419 was about someone who installed the “development environment to compile Git for Windows”, not just Git.
    See this SO answer for the difference between the two.

    So which one did you install?

    • Git-1.x.x.x...? (like ‘Git-1.7.0.2-preview20100309.exe‘),
    • or msysGit-netinstall-1.x.x...? (like ‘msysGit-netinstall-1.7.1-preview20100612.exe‘).

    My answer resolves the same error for msysgit, but may help with pure git.

    On Windows 7, I added <msysgit_dir>\mingw\bin to PATH as so_mv has recommended above (via the System Variables GUI), but I had to logout and login to OS after that, otherwise the PATH value won’t get updated.

    I had the same error on Windows 7 when running \msysgit\bin\git.exe.
    I fixed it by copying the \msysgit\mingw\bin\libiconv-2.dll to the root of Win 7 installation directory.

    I installed Git for Windows, then Git in order to copy the .dll

    This did not work for me. To solve the issue I had to add the path:

    C:\Users\*username*\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\cmd

    to the PATH environment variable.

    This cleared up the issue and I can now access git from the command prompt.

    Personally I solved it by reading the error I got from getopt.exe, that told me it was missing “libiconv2.dll”.. I had libiconv-2.dll (notice the dash “-“) in C:\Program Files (x86)\Git\bin. Making a copy and naming it libiconv2.dll did the trick for me…

    I used some chocolatey packages … maybe the actual file was renamed during its development lifetime… and the dependencies in the packages did not….

    Well hope it helps someone out there 🙂

    If the error “missing libiconv-2.dll” occurs while starting SourceTree on Windows, following worked for me (Win 8.1):

    go to

    C:\Users\$USERNAME$\AppData\Local\Atlassian\SourceTree\git_local\bin
    

    copy

    libcrypto.dll
    libcurl.dll
    libiconv-2.dll
    libssl.dll
    

    to

    C:\Users\$USERNAME$\AppData\Local\Atlassian\SourceTree\git_local\libexec\git-core
    

    One possible solution for SourceTree:

       1.Open the "Option" window.
       2.Select "Git".
       3.Than "Use System Git".
       4.And press OK button.
    

    Had this problem in SmartGit on mac.
    Fixed it by changing in
    Preferences -> Commands -> Executable

    Git Executable:

    from

    /usr/bin/git
    

    to:

    /usr/local/git/bin/git
    

    I originally tried to solve this problem by copying the dll as mentioned here but soon ran into other problems. For me the real solution was to set the path in my .bashrc file for msys to prioritize the msys binaries.

    Open the msys shell and the following line in ~/.bashrc:

    export PATH=/usr/local/bin:/mingw/bin:/bin:$PATH

    I’ve been plagued with this issue, to correct this issue, i uninstalled tortoisegit and msysgit, then i reinstalled “Git-1.8.1.2-preview20130201”.

    by doing this, this corrected my issue and i’m not able to use poshgit.

    In my case I used chocolatey (chocolatey.org) to install git.

    I had to copy libconv-2.dll to C:\ProgramData\chocolatey\bin to get it working. I’m not sure if copying the file to C:\Program Files (x86)\Git\libexec\git-core is also necessarily, as I did that first.

    I was using GitHub Desktop Version and having same problem, I changed Default shell by Setting–>Options—>Default shell and checked Git bash. I started “Open Git shell” and run “git pull” command, it fixed problem. It worked in my case.

    Copy all .dlls from:

    C:\Users\YOURUSERNAME\AppData\Local\GitHub\PortableGit_25d850739bc178b2eb13c3e2a9faafea2f9143c0\mingw32\bin

    to:

    C:\Users\YOURUSERNAME\AppData\Local\GitHub\PortableGit_25d850739bc178b2eb13c3e2a9faafea2f9143c0\mingw32\libexec\git-core

    I had the same problem, I am using Windows 10 and it is super easy to solve this problem.

    Download the dll file from:

    https://www.dll-files.com/libiconv-2.dll.html

    extract it or paste it into the mingw folder directly, it’s generally in C- drive if you have installed it using default options. Hope it helps.

    Try the following command:

    sudo rm -rf /Library/Developer/CommandLineTools 
    

    and install developer tools

    I had to deal with this same error message while trying to configure meanio, of which git is a prerequisite (my particular error was: prerequisite not found: git).
    The fix I figured out entailed copying libiconv2.dll from

    C:\Program Files (x86)\Git\bin
    

    to

    C:\Program Files (x86)\Git\libexec\git-core
    

    Then I had to make some adjustments to the windows system Environment Variables (Right click computer, go to properties, click “Advanced System Settings” on the left vertical bar, select environment variables)
    Once in Environment Variables, look in the System Variables box. Find the

    PATH
    

    Variable and add three new references:

    C:\Program Files (x86)\Git\bin;
    C:\Program Files (x86)\Git\cmd;
    C:\Program Files (x86)\Git\libexec\git-core
    

    This way all the required git files are accessible across the system path.

    Hope this helps!

    Git Baby is a git and github fan, let's start git clone.