lundi 24 octobre 2016

Dlib Face Landmark Detection Linker Error

I've recently installed OpenCV 3.0 and Dlib through Homebrew since I want to learn more about computer vision.

I was trying to compile the facial landmark detection program found on Dlib's website and I am getting the following linker error and I have been unsuccessful in finding the right compiler flags to fix this. I'm also not sure if I actually have the required software installed.

The linker error I'm getting is:

Undefined symbols for architecture x86_64:

"_DGifCloseFile", referenced from: void dlib::load_image > >(dlib::array2d >&, std::__1::basic_string, std::__1::allocator > const&) in face_landmark_detection-7a9d91.o

"_DGifOpenFileName", referenced from: void dlib::load_image > >(dlib::array2d >&, std::__1::basic_string, std::__1::allocator > const&) in face_landmark_detection-7a9d91.o

"_DGifSlurp", referenced from: void dlib::load_image > >(dlib::array2d >&, std::__1::basic_string, std::__1::allocator > const&) in face_landmark_detection-7a9d91.o

"_cblas_dgemm", referenced from: dlib::blas_bindings::cblas_gemm(dlib::blas_bindings::CBLAS_ORDER, dlib::blas_bindings::CBLAS_TRANSPOSE, dlib::blas_bindings::CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int) in face_landmark_detection-7a9d91.o

"_cblas_saxpy", referenced from: dlib::blas_bindings::cblas_axpy(int, float, float const*, int, float*, int) in face_landmark_detection-7a9d91.o "_cblas_sscal", referenced from: dlib::blas_bindings::cblas_scal(int, float, float*) in face_landmark_detection-7a9d91.o

"dgesvd", referenced from: dlib::lapack::binding::gesvd(char, char, int, int, double*, int, double*, double*, int, double*, int, double*, int) in face_landmark_detection-7a9d91.o

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

(I installed with --HEAD because brew install opencv3 would not work for me)
Homebrew installed OpenCV: brew tap homebrew/science; brew install --HEAD opencv3 Homebrew installed Dlib: brew install lib

Compile flags: g++ -std=c++11 face_landmark_detection.cpp 'pkg-config --cflags --libs opencv dlib-1'

Output of pkg-config --cflags --libs opencv dlib-1:

-I/usr/local/Cellar/opencv3/HEAD-de35c59_4/include/opencv -I/usr/local/Cellar/opencv3/HEAD-de35c59_4/include -I/usr/local/Cellar/dlib/19.1_2/include -I/usr/local/Cellar/libpng/1.6.25/include/libpng16 -L/usr/local/Cellar/opencv3/HEAD-de35c59_4/lib -L/usr/local/Cellar/dlib/19.1_2/lib -L/usr/local/Cellar/libpng/1.6.25/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -ldlib -lpng16

Can anyone please tell me which files need to be linked?

Aucun commentaire:

Enregistrer un commentaire