Open tmerten opened 3 years ago
I ran into this same issue while building something else which depends on go-face
. I don't know if cgo is meant to use pkg-config (or similar) somehow automatically but really all that was missing was the specification of where the includes and libs are.
Manually adding -I/usr/local/include
to the CXXFLAGS
comment and adding -L/usr/local/lib
to the LDFLAGS
comment in face.go got it compiling for me, although I expect that is not the intended workflow.
@jacquesh : thanks, that worked for me, too.
For anyone hitting the same issue, using the following env
works without needing to modify any source files.
Here I was building photoview
which uses go-face
as a dependency:
env CGO_CFLAGS="-I/usr/local/include/" CGO_CXXFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" go build -v -o photoview .
Since FreeBSD installs all extra libraries in /usr/local
it would make sense to add the above flags to CGO in go
package on FreeBSD by default for better user experience.
I'll check if it's possible and open a PR for the go
package.
Thanks for the env line - that just saved me a lot of time!
Hi there,
I am trying to
go get
go-face on freebsd1202000
(well, it is used as a dependency in photoview but I guess that does not matter).dlib
via apkg install dlib-cpp
which installs version19.21_1
in/usr/local
./usr/local
.However, in both cases I am getting the following:
Maybe somebody has an idea. Unfortunately my go experience is in the range zero + search engine. (This pointed me to #19 but I could not solve anything from there...)