git-crypt icon indicating copy to clipboard operation
git-crypt copied to clipboard

Fix build on Mingw/Cygwin (fixes #144)

Open rasa opened this issue 7 years ago • 2 comments

rasa avatar Feb 23 '18 03:02 rasa

Executables are at: https://github.com/rasa/git-crypt/releases and can be installed via scoop: scoop install git-crypt

rasa avatar Feb 23 '18 07:02 rasa

I want to add here that in order to make this work I had to link against the dll version of the crypto library:

make would run into a stack of errors of the form:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../lib\libcrypto.a(b_addr.o):(.text+0xab): undefined reference to `__imp_getnameinfo'

What I did then was run

g++ -Wall -pedantic -Wno-long-long -O2 -std=c++11 -static -o git-crypt git-crypt.o commands.o crypto.o gpg.o key.o util.o parse_options.o coprocess.o fhstream.o crypto-openssl-10.o crypto-openssl-11.o -lgdi32 /mingw64/lib/libcrypto.dll.a

in order to link directly to the dll and not /mingw64/lib/libcrypto.a. Seems something's off with the way libcrypto is compiled (according to this stack overflow)

Hoping this helps someone trying to get this compiled on Windows.

ezk84 avatar Jul 16 '19 10:07 ezk84