# Git For Windows SDK - cannot build

2 messages from 2017-04-25 to 2017-04-25. Participants: Stepan Kasal, Johannes Schindelin.
Thread: https://gitlist.dev/t/45795

## Stepan Kasal, 2017-04-25 11:13

Subject: Git For Windows SDK - cannot build
Message-ID: <20170425111315.GB13400@ucw.cz>
URL: https://gitlist.dev/e/20170425111315.GB13400%40ucw.cz

```
Hello,
I have installed git for windows sdk from the web and tried to build it.

The build ended with a link bug; see below.

Could you please help me with debugging that?

I have tried various pacman -S libiconv; pacman -Su; pacman -S libiconv-devel
but I still do not understand pacman and its dependencies, I'm afraid.

Hints or pointers to doc welcome.

Stepan Kasal

$ make
    LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv':
/usr/src/git/utf8.c:463: undefined reference to `libiconv'
/usr/src/git/utf8.c:463:(.text+0xf77): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `libiconv'
libgit.a(utf8.o): In function `reencode_string_len':
/usr/src/git/utf8.c:524: undefined reference to `libiconv_open'
/usr/src/git/utf8.c:524:(.text+0xff1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `libiconv_open'
/usr/src/git/utf8.c:535: undefined reference to `libiconv_close'
/usr/src/git/utf8.c:535:(.text+0x1018): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `libiconv_close'
/usr/src/git/utf8.c:529: undefined reference to `libiconv_open'
/usr/src/git/utf8.c:529:(.text+0x104a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `libiconv_open'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2061: git-credential-store] Error 1


```

## Johannes Schindelin, 2017-04-25 21:33

Subject: Re: Git For Windows SDK - cannot build
Message-ID: <alpine.DEB.2.20.1704252330480.3480@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1704252330480.3480%40virtualbox
In-Reply-To: <20170425111315.GB13400@ucw.cz>

```
Hi Stepan,

as I commented on your post to the Git for Windows mailing list:

On Tue, 25 Apr 2017, Stepan Kasal wrote:

> I have installed git for windows sdk from the web and tried to build it.

Nobody in the project found the time to update the website yet, but we do
have a simpler way to install the SDK now:

	git clone https://github.com/git-for-windows/git-sdk-64

> $ make
>     LINK git-credential-store
> libgit.a(utf8.o): In function `reencode_string_iconv':
> /usr/src/git/utf8.c:463: undefined reference to `libiconv'
> /usr/src/git/utf8.c:463:(.text+0xf77): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `libiconv'

This most likely means that `pacman -Sy mingw-w64-x86_64-libiconv` should
be called before re-running `make`.

The reason why the `libiconv` package (without `mingw-w64-` prefix) is not
helping: that package is an *MSYS2* package, i.e. it implicitly links to
the MSYS2 runtime (the POSIX emulation layer derived from Cygwin that we
use in Git for Windows to run Shell and Perl scripts, as well as OpenSSH).

Ciao,
Johannes

```
