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

GitMsysgit

Git Problem Overview


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.

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 Solutions


Solution 1 - Git

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)

Solution 2 - Git

  • copy /Program Files/Git/bin/libiconv-2.dll
  • to /Program Files/Git/libexec/git-core/

Solution 3 - Git

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!

Solution 4 - Git

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.

Solution 5 - Git

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

Solution 6 - Git

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.

Solution 7 - Git

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

Solution 8 - Git

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

Solution 9 - Git

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.

Solution 10 - Git

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.

Solution 11 - Git

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.

Solution 12 - Git

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.

Solution 13 - Git

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.

Solution 14 - Git

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

Solution 15 - Git

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

Solution 16 - Git

One possible solution for SourceTree:

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

Solution 17 - Git

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

Solution 18 - 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

Solution 19 - Git

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.

Solution 20 - Git

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.

Solution 21 - Git

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.

Solution 22 - Git

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

Solution 23 - Git

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.

Solution 24 - Git

Try the following command:

sudo rm -rf /Library/Developer/CommandLineTools 

and install developer tools

Solution 25 - Git

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!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser413945View Question on Stackoverflow
Solution 1 - GitpaulecoyoteView Answer on Stackoverflow
Solution 2 - GitsqzamanView Answer on Stackoverflow
Solution 3 - Gituser413945View Answer on Stackoverflow
Solution 4 - Gitso_mvView Answer on Stackoverflow
Solution 5 - GitCoolerView Answer on Stackoverflow
Solution 6 - GitErdinç ÇorbacıView Answer on Stackoverflow
Solution 7 - GitwyttenView Answer on Stackoverflow
Solution 8 - GitKristofMolsView Answer on Stackoverflow
Solution 9 - GitKingenView Answer on Stackoverflow
Solution 10 - Gituser1292546View Answer on Stackoverflow
Solution 11 - GitsompylasarView Answer on Stackoverflow
Solution 12 - GitBoris JockovView Answer on Stackoverflow
Solution 13 - GitSebastien V.View Answer on Stackoverflow
Solution 14 - GitMaurice CGP PetersView Answer on Stackoverflow
Solution 15 - GitfelixView Answer on Stackoverflow
Solution 16 - GitflaviussnView Answer on Stackoverflow
Solution 17 - GitVonCView Answer on Stackoverflow
Solution 18 - GitJudah MenterView Answer on Stackoverflow
Solution 19 - GitAdamWhiteView Answer on Stackoverflow
Solution 20 - GitLuke ChaversView Answer on Stackoverflow
Solution 21 - GitMundroidView Answer on Stackoverflow
Solution 22 - GitChris HalcrowView Answer on Stackoverflow
Solution 23 - GitSamriddhi VermaView Answer on Stackoverflow
Solution 24 - GitSamolazov RomanView Answer on Stackoverflow
Solution 25 - GitdeusofnullView Answer on Stackoverflow