2016-05-28 09:28

在Cygwin64上编译cgo lib:“ ld:找不到-lmingw32”

  • cygwin
  • sqlite
  • gcc
  • cgo

I'm trying to use a cgo library on Windows, namely

I use Cygwin64 and installed with all "Development" packages, so gcc is availabe.

But running go get 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

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?

Or is there a better way to use the library on Windows?

Note that the README states that

However, if you install go-sqlite3 with go install, you don't need gcc to build your app anymore

but I get the same error message if I use go install.

$ go version
go version go1.6.2 windows/amd64
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享