Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how execute csharp method from go c-shared library? #17

Open
victorluk3 opened this issue Dec 5, 2019 · 4 comments
Open

how execute csharp method from go c-shared library? #17

victorluk3 opened this issue Dec 5, 2019 · 4 comments

Comments

@victorluk3
Copy link

victorluk3 commented Dec 5, 2019

I tried use the a go library on csharp and use callbacks, but the application entire crash by the library with the error:
unexpected fault address 0xffffffffffffffff fatal error: fault [signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x627ca9ab]

go code:

package main

import "C"
import "fmt"

type externFunc func(int)

//export Connect
func Connect(fn externFunc) {
    fmt.Println("fn ",fn)

    for i:= 0; i<3;i++{
       fn(10)
    }

} 

How is the way to execute callbacks with c-shared?

@vladimirvivien
Copy link
Owner

My apologies, I do not know anything about CSharp. Cannot help.

@vladimirvivien
Copy link
Owner

See #18

@victorluk3
Copy link
Author

but the code in go, is the correct way to make callbacks?

@vladimirvivien
Copy link
Owner

I don't quite understand. The code is in csharp. Go offers one way for interoperability with external languages. I assume the csharp code is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants