You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Go, and I'm attempting to learn about how to interoperate between C and Go. I thought a good way to learn would be to go through some of the examples in the repo. However it appears that a change in Go 1.4 has made one of the examples not work anymore. Others seem to be having related issues: #9132
$ go version
go version go1.4 darwin/amd64
$ cd misc/cgo/testdefs
$ ./test.bash
can't load package: package .: C source files not allowed when not using cgo: cdefstest.c main.c
The text was updated successfully, but these errors were encountered:
You're right: testcdefs doesn't work any more, and we should fix that or delete the directory.
That said, that directory is not an example of how to interoperate between C and Go. It's a test of the -cdefs option of the cgo tool, which is not intended for use by anybody other than people bootstrapping a Go port to a new operating system.
Hi @ianlancetaylor, remember me from the Berkeley google shuttle? :)
I guess I was mistaken about the purpose of that directory – the blog post at http://blog.golang.org/c-go-cgo links to misc/cgo with the phrase "The cgo examples in the Go tree demonstrate more advanced concepts."
I'm brand new to Go, and made the mistake of getting my feet wet by attempting to call into Go from an existing C++-based mobile app :) Probably should've started with something simpler.
The docs seem to thoroughly cover how to call into C from Go, but not the other way around...
I'm new to Go, and I'm attempting to learn about how to interoperate between C and Go. I thought a good way to learn would be to go through some of the examples in the repo. However it appears that a change in Go 1.4 has made one of the examples not work anymore. Others seem to be having related issues: #9132
https://github.com/golang/go/tree/master/misc/cgo/testcdefs
The text was updated successfully, but these errors were encountered: