Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identifier "_Ctype_struct_facerec" may conflict with identifiers generated by cgo #22

Closed
nathany opened this issue Feb 26, 2019 · 3 comments

Comments

@nathany
Copy link
Contributor

nathany commented Feb 26, 2019

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
Copy link
Contributor Author

nathany commented Feb 26, 2019

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
Copy link

then how do we solve this?

@nathany
Copy link
Contributor Author

nathany commented Feb 22, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants