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
....go:12:2: could not determine kind of name for C.do_something
gcc errors for preamble:
....go:5:19: error: unknown type name '_GoString_'
void do_something(_GoString_ go_string) {
^~~~~~~~~~
A C function may be declared in the Go file with a parameter type of the special name _GoString_. This function may be called with an ordinary Go string value. The string length, and a pointer to the string contents, may be accessed by calling the C functions
These functions are only available in the preamble, not in other C files. The C code must not modify the contents of the pointer returned by _GoStringPtr. Note that the string contents may not have a trailing NUL byte.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.4 linux/amd64
Does this issue reproduce with the latest release?
I don't know.
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Go compiles it successfully.
What did you see instead?
Documentation
https://golang.org/cmd/cgo/#hdr-Go_references_to_C
The text was updated successfully, but these errors were encountered: