Kagami/go-face

fatal error: dlib/graph_utils.h: No such file or directory

sukshifr opened this issue · 11 comments

Ubuntu 16.04
I have created dlib-1.pc and copied it to /usr/local/lib/pkgconfig/dlib-1.pc
Installing dlib through PPA

# github.com/Kagami/go-face
classify.cc:1:30: fatal error: dlib/graph_utils.h: No such file or directory
 #include <dlib/graph_utils.h>
                              ^
compilation terminated.

Any idea why this error is coming?
Docker File

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:kagamih/dlib
RUN apt-get update && apt-get install -y wget curl
RUN apt-get install -y libdlib-dev


FROM golang:1.11.1 as builder

# build the go binary
#
ENV GOPATH /go
ADD . /project
WORKDIR /project


ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig


#WORKDIR /root/
#COPY dlib-1.pc /usr/local/lib/pkgconfig/dlib-1.pc

WORKDIR /project
RUN GO111MODULE=on go build -o app main.go

When I remove /usr/local/lib/pkgconfig/dlib-1.pc below error is shown

# pkg-config --cflags  -- dlib-1
Package dlib-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dlib-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dlib-1' found
pkg-config: exit status 1

dlib-1.pc file

libdir=/usr/lib/x86_64-linux-gnu
includedir=/usr/include

Name: dlib
Description: Numerical and networking C++ library
Version: 19.15.0
Libs: -L${libdir} -ldlib -L/opt/intel/mkl/lib/intel64 -lmkl_rt
Cflags: -I${includedir} -I/opt/intel/mkl/include
Requires:

You don't need to edit pkgconfig when installing dlib from PPA. Delete /usr/local/lib/pkgconfig/dlib-1.pc and try again.

I deleted that and tried again but another error shows up.I've Updated the question with my docker file and the error please check it. I've been at it for the past 1 week but nothing works.

That's strange, looks pretty fine. Could you check the contents of /usr/lib/x86_64-linux-gnu/pkgconfig/dlib-1.pc? It should be installed by the PPA.

Maybe pkg-config doesn't try to search there inside a docker container? Try to export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig environment variable.

I updated the question with dlib-1.pc file and also I've set ENV variable as you said but still same error occurs. Can you please check if i set the env var correctly?

I've just made fresh docker container from ubuntu:16.04, installed software-properties-common, libdlib-dev, pkg-config and

pkg-config --cflags  -- dlib-1

works perfectly fine for me. I guess there is something wrong in your docker files.

Can you post your docker file please?

I've just run docker run --name test --rm -it ubuntu:16.04 and typed commands by hand.

tpoxa commented

Someone, please, publish finally working Dorkerfile.

I also have this problem, I am developing in Windows environment, the environment has been configured, but I am not sure why

niuhs commented

那你怎么解决了?

时间太久了我也忘记了,你可以问一下chatgpt