2021
06-11
06-11
Golang 编译成DLL文件的操作
首先撰写golang程序exportgo.go:packagemainimport"C"import"fmt"//exportPrintByefuncPrintBye(){fmt.Println("FromDLL:Bye!")}//exportSumfuncSum(aint,bint)int{returna+b;}funcmain(){//NeedamainfunctiontomakeCGOcompilepackageasCsharedlibrary}编译成DLL文件:gobuild-buildmode=c-shared-oexportgo.dllexportgo.go编译后得到exportgo.dll和exportgo.h两个...
继续阅读 >