Kagami/go-face

identifier "_Ctype_struct_facerec" may conflict with identifiers generated by cgo

nathany opened this issue · 3 comments

In Go 1.12 there is the following error:

❯ go build
# github.com/Kagami/go-face
./face.go:25:7: identifier "_Ctype_struct_facerec" may conflict with identifiers generated by cgo

macOS 10.14.3, dlib 19.16 via Homebrew. It compiles without error in Go 1.11 after running the sed command in the README.

Mangled C names are no longer accepted in packages that use Cgo. Use the Cgo names instead. For example, use the documented cgo name C.char rather than the mangled name _Ctype_char that cgo generates. https://golang.org/doc/go1.12#cgo

The following works fine for me in Go 1.12 and prior versions (tested Go 1.11, 1.10, 1.09)

// A Recognizer creates face descriptors for provided images and
// classifies them into categories.
type Recognizer struct {
	ptr *C.facerec
}

then how do we solve this?

It was resolved in #23.

If you're seeing a similar issue, it's probably best to open a new issue instead of commenting on a closed one.