我有用C编写的第三方Windows库的.lib,.h和.dll文件(使用Visual Studio compiller)

怎么可以从Go程序中使用这样的.dll?如果cgo正在使用MinGW C,它有可能吗?

你能在网上指出任何例子吗?我尝试使用 syscall.NewLazyDLL() 调用本机Windows DLL,但它不适用于第三方DLL .

谢谢!

我得到的错误如下:

C:\DOCUME~1\Alex\LOCALS~1\Temp\go-build023179027\zelid\gowingui.a(_all.o): malformed pe file: unexpected flags 0xe0500020 for PE section .text

C:\DOCUME~1\Alex\LOCALS~1\Temp\go-build404633023\zelid\gowingui.a(_all.o): malformed pe file: unexpected flags 0xe0500020 for PE section .text main._Cfunc_HTMLayoutProcND: undefined: _cgo_c2d779df8b44_Cfunc_HTMLayoutProcND

$ gcc --version gcc (tdm-2) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ go version go version go1.3.3 windows/386