Answer the question
In order to leave comments, you need to log in
How to execute a DLL file using Golang?
I made a DLL file with go build -o testdll.dll -buildmode=c-shared dllGo.go
dllGo.go:
package main
import (
"fmt"
"os"
)
func TestCalc(a, b int) int {
return a + b
}
func main() {
fmt.Println(TestCalc(7, 9))
f, err := os.Create("working.txt")
if err != nil {
fmt.Println(err)
}
f.Close()
}
package main
import (
"fmt"
"syscall"
)
func main() {
h, err := syscall.LoadLibrary("testdll.dll")
if err != nil {
fmt.Println(err)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question