identifier "_Ctype_struct_facerec" may conflict with identifiers generated by cgo
nathany opened this issue · 3 comments
nathany commented
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
nathany commented
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
}
LouisAldorio commented
then how do we solve this?