threads / discuss / 45795

Git For Windows SDK - cannot build

Subject: Git For Windows SDK - cannot build

## tl;dr

2 messages between Apr 25, 2017 and Apr 25, 2017.

replies: 1people: 2as markdown or json

Stepan Kasal· Apr 25, 2017, 11:13 UTC · lore

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· Apr 25, 2017, 21:33 UTC · re: Stepan Kasal · lore

Re: Git For Windows SDK - cannot build

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
Show 5 quoted lines
> $ 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

← back to recent threads