-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: example for calling Go from C not working #28471
Comments
What example are you taking about? Please show us your code. It sounds like your code was wrong, and that you fixed it. So I'm not sure what concrete step the Go project should take. |
Hi! Regarding your question: No, I did not make any changes to this particular code. |
The Specify the package instead of a single file and things will work. |
Well, go build doesn't throw an error, but I can't find an executable...?
|
Calling It doesn't sound like there is anything for the Go project to change here, so I'm going to close this issue. Please comment if you disagree. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.1 linux/amd64
Does this issue reproduce with the latest release?
not tested
What operating system and processor architecture are you using (
go env
)?What did you do?
I tried to follow the example code from here:
https://github.com/golang/go/wiki/cgo#calling-go-functions-from-c
created
foo.c
andfoo.go
in a directory with copy&pasted code.Ran
go build -a foo.go
What did you expect to see?
Successful compilation
What did you see instead?
Edit: I've sucessfully created a PoC code for calling C with Go with the sparse info I could find. Calling Go from C however seems to be even less documented, which makes it even more frustrating, when even the basic examples in the documenation are not working. I volunteer to make an edit if we can find a proper solution to this issue as I feel newbies after me will have the same problems.
The text was updated successfully, but these errors were encountered: