doujiekeyan0622 2016-05-28 09:28
浏览 1551
已采纳

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

I'm trying to use a cgo library on Windows, namely github.com/mattn/go-sqlite3

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

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

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 github.com/mattn/go-sqlite3, 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
  • 写回答

3条回答 默认 最新

  • doumeng9188 2016-05-28 16:51
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 将两文件中相同行数行 打印至同一行
  • ¥15 关于#单片机#的问题:c51单片机想做个密码重置按键K13不知道如何去做,用了24c02来存储
  • ¥20 有没有会python的帮帮我😥
  • ¥15 如何修改系统里的设备信息及某某镇某某村如图所示
  • ¥15 变数的长度不一样”。是什么原因呢?如何修改?
  • ¥15 matlab作业不会写
  • ¥15 eclipse mqtt 消息消费问题
  • ¥15 vue2(标签-chrome|关键词-浏览器兼容)
  • ¥15 python网络流自动生成系统 医学领域
  • ¥15 sql查询仓库里都有什么