Closed Masber closed 5 months ago
Hi @Masber.
you're missing a #[repr(C)]
annotation on the CMember
struct. cbindgen will declare this struct as opaque in that case (ie the struct exists and you can have pointers to it but you can't access fields as the memory layout is not guaranteed and the rust compiler may have done some funky things with it)
closing this as this is definitely not an ffi-convert issue
Dear ffi convert team,
I am learning go, rust and the interactions between these 2 languages by consuming rust methods by golang.
I have done some tests and I am getting error in cgo trying to understand the header files generated by dbindgen...
This is my rust code
This is my build.rd for dbindgen
And this is the headers file generated
I know very little but I think the below may not right?
I would expect something like below?
I crated an example here https://github.com/Masber/rust-ffi this creates a shared library that I am using in a Go code, the header file is automatically generated by cbindgen during the build process
cargo build --release