user413945
user413945

Reputation: 1141

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.

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,

Upvotes: 94

Views: 95277

Answers (25)

Samolazov Roman
Samolazov Roman

Reputation: 1

Try the following command:

sudo rm -rf /Library/Developer/CommandLineTools 

and install developer tools

Upvotes: 0

Samriddhi Verma
Samriddhi Verma

Reputation: 1

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.

Upvotes: 0

Cooler
Cooler

Reputation: 319

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

Upvotes: 10

paulecoyote
paulecoyote

Reputation: 1723

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)

Upvotes: 105

flaviussn
flaviussn

Reputation: 1355

One possible solution for SourceTree:

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

Upvotes: 1

Chris Halcrow
Chris Halcrow

Reputation: 31960

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

Upvotes: 0

Muneesh
Muneesh

Reputation: 463

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.

Upvotes: 0

felix
felix

Reputation: 11

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

Upvotes: 1

Maurice CGP Peters
Maurice CGP Peters

Reputation: 368

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

Upvotes: 1

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.

Upvotes: 3

Luke Chavers
Luke Chavers

Reputation: 703

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.

Upvotes: 0

deusofnull
deusofnull

Reputation: 91

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!

Upvotes: -1

Sebastien V.
Sebastien V.

Reputation: 13

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.

Upvotes: 1

wytten
wytten

Reputation: 3000

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

Upvotes: 3

AdamWhite
AdamWhite

Reputation: 1034

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.

Upvotes: 0

Kingen
Kingen

Reputation: 21

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.

Upvotes: 2

Boris Jockov
Boris Jockov

Reputation: 614

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.

Upvotes: 1

sompylasar
sompylasar

Reputation: 934

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.

Upvotes: 2

user1292546
user1292546

Reputation:

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.

Upvotes: 2

Judah Menter
Judah Menter

Reputation: 290

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

Upvotes: 0

sqzaman
sqzaman

Reputation: 639

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

Upvotes: 42

so_mv
so_mv

Reputation: 3998

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.

Upvotes: 14

user413945
user413945

Reputation: 1141

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!

Upvotes: 15

VonC
VonC

Reputation: 1325037

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

Upvotes: 0

Kristof Mols
Kristof Mols

Reputation: 3557

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

Upvotes: 2

Related Questions