i was looking for how to create a dll file from go and i used the following command
go build -o client.dll -buildmode c-shared
My fiile has a main function without any code on it and i have another function called “TestMain”
which contain the all reuired code for the script. Now how should i run this dll ? i tried with : rundll32 client.dll,TestMain
but i got an error that “Missing Entry: TestMain” so i need to know how can i compile it and run it
Solved
It seems the problem because i didn’t write any code in the main function, so i write a simple print line and then i compiled using.
go build -ldflags “-s -w” -buildmode=c-shared -o file.dll ./file.go