Re: [go-nuts] Returning pointer to struct from cgo to C cause panic: runtime error: cgo result has Go pointer

2018-12-19 Thread eran . yasso
solved it: //export Eb_TcpSecureStreamCreateListener func Eb_TcpSecureStreamCreateListener(listenIp string, listenPort int) unsafe.Pointer, retStatus { pmap := { } server := Server{ } server.listener = secConn.NewListener(server.listenAddress,

Re: [go-nuts] Returning pointer to struct from cgo to C cause panic: runtime error: cgo result has Go pointer

2018-12-18 Thread Ian Lance Taylor
On Tue, Dec 18, 2018 at 6:27 AM wrote: > > I have to projects. One is cgo and one is C application. > The cgo has a function which needs to return pointer to struct. > The C app receives this pointer and then calls other function in cgo with > this pointer. > I build the cgo as shared lib: > >

[go-nuts] Returning pointer to struct from cgo to C cause panic: runtime error: cgo result has Go pointer

2018-12-18 Thread eran . yasso
Hi, I have to projects. One is cgo and one is C application. The cgo has a function which needs to return pointer to struct. The C app receives this pointer and then calls other function in cgo with this pointer. I build the cgo as shared lib: *go build -o ebsdk.so -buildmode=c-shared* The