On Sun, Mar 17, 2019 at 9:37 PM <[email protected]> wrote: > > package main > > import( > ) > > /* > #include <stdio.h> > */ > import "C" > > func main() { > C.printf(C.CString("hello")) > } > > //---->build this file with go build, i got > //./testems.go:12:2: unexpected type: ... > > could someone help me with this trouble? thanks!
Calling variadic C functions like printf is not supported. See the docs (https://golang.org/cmd/cgo) for a workaround. I admit the error message is not the best. Feel free to open an issue to improve it, at https://golang.org/issue. Thanks. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
