Correction: The Go function is: func Open() { var dev *C.device_t C.open(&dev) }
On Saturday, September 25, 2021 at 10:59:45 AM UTC-3 Elemer Pixard wrote: > I am trying to call the following C function (simplified version from a C > library) from Go, > and I got compiler errors: > typedef void device_t; > void open(device_t **dev) { > } > > *Go Function*: > func Open() { > var dev C.device_t > C.open(&&dev) > } > > *Compiler (v1.17) error:* > cannot use _cgo0 (type **_Ctype_void) as type *unsafe.Pointer in argument > to _Cfunc_open > > How to fix that? > Regards. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/06c6a059-c55e-4ed8-9487-8950c91412c0n%40googlegroups.com.