Skip to content

Instantly share code, notes, and snippets.

@fangdingjun
Created March 23, 2017 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fangdingjun/27e3f0b3b05ae58dd1042a61c8f1f51e to your computer and use it in GitHub Desktop.
Save fangdingjun/27e3f0b3b05ae58dd1042a61c8f1f51e to your computer and use it in GitHub Desktop.
build golang package to dll on windows

build golang package to dll on windows, refer to golang/go#11058

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
lib /def:xxx.def /machine:x64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment