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

在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 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示