I am given this code for a program called face_landmark_detection_ex. There is no makefile.
How can I find out what command I need to type in, in Ubuntu, to produce an executable that I can run?
I tried to compile it with:
g++ face_landmark_detection_ex.cpp -o face $(pkg-config --cflags --libs dlib)
But that returned:
Package dlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `dlib.pc'
to the PKG_CONFIG_PATH environment variable
And a ton loads of errors like:
No package 'dlib' found
In file included from /usr/local/include/dlib/geometry/rectangle.h:7:0,
from /usr/local/include/dlib/geometry.h:6,
from /usr/local/include/dlib/image_processing/object_detector.h:7,
from /usr/local/include/dlib/image_processing/frontal_face_detector.h:7,
from face_landmark_detection_ex.cpp:41:
/usr/local/include/dlib/algs.h:17:10: error: #error "Dlib requires C++11 support. Give your compiler the -std=c++11 option to enable it."
#error "Dlib requires C++11 support. Give your compiler the -std=c++11
^
In file included from /usr/include/c++/5/array:35:0,
from /usr/local/include/dlib/serialize.h:150,
from /usr/local/include/dlib/geometry/rectangle.h:10,
from /usr/local/include/dlib/geometry.h:6,
from /usr/local/include/dlib/image_processing/object_detector.h:7,
from /usr/local/include/dlib/image_processing/frontal_face_detector.h:7,
from face_landmark_detection_ex.cpp:41:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
...and so forth.
I already did: sudo apt install libdlib-dev
Update
Later, I tried running:
g++ face_landmark_detection_ex.cpp -l dlib -std=c++11 -o main
But that didn't seem to work. It produced these "undefined reference" errors, including for symbols in the dlib namespace. The full errors are in pastebin; here are the first few lines:
$ g++ face_landmark_detection_ex.cpp -l dlib -std=c++11 -o main
/tmp/ccY36F7N.o: In function `main':
face_landmark_detection_ex.cpp:(.text+0x15e): undefined reference to `dlib::image_window::image_window()'
face_landmark_detection_ex.cpp:(.text+0x16d): undefined reference to `dlib::image_window::image_window()'
face_landmark_detection_ex.cpp:(.text+0x431): undefined reference to `dlib::image_window::clear_overlay()'
face_landmark_detection_ex.cpp:(.text+0x4a1): undefined reference to `dlib::image_window::add_overlay(std::vector<dlib::image_display::overlay_line, std::allocator<dlib::image_display::overlay_line> > const&)'
face_landmark_detection_ex.cpp:(.text+0x5e3): undefined reference to `dlib::image_window::~image_window()'
face_landmark_detection_ex.cpp:(.text+0x5f2): undefined reference to `dlib::image_window::~image_window()'
face_landmark_detection_ex.cpp:(.text+0x773): undefined reference to `dlib::image_window::~image_window()'
face_landmark_detection_ex.cpp:(.text+0x78a): undefined reference to `dlib::image_window::~image_window()'
/tmp/ccY36F7N.o: In function `dlib::lapack::binding::gesdd(char, int, int, double*, int, double*, double*, int, double*, int, double*, int, int*)':
face_landmark_detection_ex.cpp:(.text._ZN4dlib6lapack7binding5gesddEciiPdiS2_S2_iS2_iS2_iPi[_ZN4dlib6lapack7binding5gesddEciiPdiS2_S2_iS2_iS2_iPi]+0x91): undefined reference to `dgesdd_'