问题描述
我试图在Windows上使用cgo库,即 github.com/mattn/go-sqlite3
I'm trying to use a cgo library on Windows, namely github.com/mattn/go-sqlite3
但运行 go go github.com/mattn
I use Cygwin64 and installed with all "Development" packages, so gcc is availabe.
我使用Cygwin64并安装了所有Development包,所以gcc可用。 / go-sqlite3
导致:
But running go get github.com/mattn/go-sqlite3
results in:
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingwex
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingw32
如果我在Cygwin安装程序中搜索mingwex和mingw32,则无法获得结果。我在寻找错误的名字,或者它们在64位系统上不可用?
If I search for "mingwex" and "mingw32" in the Cygwin installer, I get no results. Am I looking for the wrong names or are they not available on 64 bit systems?
或者有没有更好的方式在Windows上使用库?
Or is there a better way to use the library on Windows?
请注意,自述文件指出
但如果我使用 go install
,则会得到相同的错误信息。
but I get the same error message if I use go install
.
$ go version
go version go1.6.2 windows/amd64
推荐答案
终于为我工作了(而不是Cygwin)是从并设置PATH,使gcc从 C:\ TDM-GCC-64 \\ \\ bin
被使用。
What finally worked for me (instead of Cygwin) is to download TDM MinGW-w64 from http://tdm-gcc.tdragon.net/download and set the PATH such that gcc from C:\TDM-GCC-64\bin
is used.
这篇关于在Cygwin64上编译cgo lib:“ld:can not find -lmingw32”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!