On Tuesday, 4 October 2022 at 05:47:49 UTC+1 squadglad...@gmail.com wrote:
> We have some disk space restrictions and hence we do not want to include
> the common code as a library in the service. That will increase the size of
> each exe. We would like to keep the common code and service code
@squadglad, it is certainly possible to compile go code into a windows DLL,
and to use cgo. I've done it successfully.
You'll want to study up on cgo. There are strict rules for keeping go
pointers and C pointers apart, and they
can be subtle. You'll need to be become well versed in the details
We have some disk space restrictions and hence we do not want to include
the common code as a library in the service. That will increase the size of
each exe. We would like to keep the common code and service code
independent of each other. Changes in one should not affect or cause
recompilation of
On Monday, 3 October 2022 at 10:40:06 UTC+1 squadglad...@gmail.com wrote:
> We are trying to use a common code as a DLL which is shared by multiple
> services.
>
You've mixed a problem and solution statement together.
You want to share code between multiple services: if so, there are other
sol
We are trying to use a common code as a DLL which is shared by multiple
services. The services need to support multiple platforms like Linux((amd64
and Armv7), Windows and FreeBSD. and we are using the following command to
generate the DLL
go build -buildmode=c-shared -o calc.so calc.go -- linux
g
> is go-plugin supported by Windows?
If you mean go's own plugin system, then no: https://pkg.go.dev/plugin
(sorry, I should have remembered that)
If you mean the go-plugin library from Hashicorp: I believe it should be
fine. It's used by Hashicorp Vault, and Vault supports Windows:
https://ww
is go-plugin supported by Windows?...We want to create go dll and tey to
access through go code
On Thursday, September 29, 2022 at 5:12:34 PM UTC+5:30 Brian Candler wrote:
> My first reaction is, do you *really* want to call a Go DLL from a Go main
> program? It seems to me like you will have t
My first reaction is, do you *really* want to call a Go DLL from a Go main
program? It seems to me like you will have two active copies of the Go
runtime with their own garbage collectors etc.
Go "plugins" might be closer to what you need:
https://medium.com/learning-the-go-programming-language/
Oh, hang on, please ignore my last message. It's that was because the
*caller* was defined that way - it's NOT a Go thing. Oops, my bad.
Peter
On Thursday, 29 September 2022 at 10:33:23 UTC+1 Peter Galbavy wrote:
> On Linux at least - I have not tried building or using a Windows DLL, you
> hav
On Linux at least - I have not tried building or using a Windows DLL, you
have to accept C-style args and process them in the exported function
signature:
e.g.
//export SendMail
func SendMail(n C.int, args **C.char) C.int {
conf := parseArgs(n, args)
...
Here my parseArgs() func loops over
10 matches
Mail list logo