-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git2go on Windows #155
Comments
That looks like what happens when you don't use 'make install' to install the package. None of this should have anything to do with Windows, especially if you're building on MinGW which takes away the Windows system. |
If you did install via 'make install', then it looks like whatever compiler you're using does not accept the flags we pass in order to combine the static archive with libgit2 in it and |
I tried to do it through
|
I've got a similar problem trying to build this on windows failed with
I'm always having the problem that gcc is told to look at the wrong directory:
Has anyone an idea on how to circumvent this? I'm completely new to go, any help would be greatly appreciated. |
UPDATE 2If specifying
UPDATE 1The compiled library After more research I think I should use
ORIGINAL MESSAGEIs anyone able to make this work on Windows? I managed to compile $ go install
# github.com/libgit2/git2go
C:/mingw-w64/x86_64-5.1.0-win32-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible .\vendor\libgit2\build\Debug/git2.lib when searching for -lgit2
C:/mingw-w64/x86_64-5.1.0-win32-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible .\vendor\libgit2\build\Debug/git2.lib when searching for -lgit2
C:/mingw-w64/x86_64-5.1.0-win32-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible .\vendor\libgit2\build\Debug\git2.lib when searching for -lgit2
C:/mingw-w64/x86_64-5.1.0-win32-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: cannot find -lgit2
collect2.exe: error: ld returned 1 exit status I'm using:
The complete list of commands is: go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git checkout next
git submodule update --init # get libgit2
cd vendor/libgit2
mkdir build
cd build
cmake -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:/libgit2 ..
cmake --build . --target install
cd ..\..\..
$env:PKG_CONFIG_PATH="C:\libgit2\lib\pkgconfig"
go install
# errors follow ... I also tried the
|
@clns I tried the same things and couldn't get it working. So I ended up compiling |
Try to put |
That worked, thanks!!! Should be interesting to see if this can be fixed before Go 1.5. Till' then, I guess this solution would work. |
Anyone having any luck compiling git2go as a static library on Windows amd64 with go 1.5? I'm trying the steps from above but with the same results.
I have compiled libgit2 without any errors, at |
As far as the WinHTTP errors, adding If it's completely failing to find the libc/crt functions... then I don't know. The Windows system where I have go installed fails to build libgit2 with gcc so I haven't been able to investigate more. |
I was able to successfully build on Windows from a MinGW Shell installed using MSYS2. See PR #307 |
I'm trying to use git2go on Windows 7 x64. I was able to build libgit2 (through mingw) and install git2go package to usual pkg location (
pkg\windows_amd64\github.com\libgit2\git2go.a
). But when I try to importgithub.com/libgit2/git2go
package and build an app I get the following errors:Any ideas on how to make it work on Windows?
The text was updated successfully, but these errors were encountered: