Monday, October 24, 2016

Go: Windows DLL

https://github.com/golang/go/issues/11058 workaround by @chai2010
go build -buildmode=c-archive -o libxxx.a gcc -m64 -shared -o xxx.dll xxx.def libxxx.a -Wl,--allow-multiple-definition -static -lstdc++ -lwinmm -lntdll -lWs2_32
Then use VS's lib command to generate xxx.lib:
lib /def:xxx.def /machine:x64