Chaithra Joshi Chaithra Joshi - 1 month ago 43
C++ Question

How to compile dlib 19.2 in visual studio 2015 without using cmake

I am using Dlib for face landmark detection for my academic project.

When I am running Dlib 19.2

face_landmark_detection_ex.cpp
file in Visual Studio 2015 express, I wasn't able to get the results.

The steps followed


  1. Created new project.

  2. Added existing
    face_landmark_detection_ex.cpp
    and
    source.cpp
    file from
    dlib\all
    folder and added same files to project folder

  3. In VC++ directories added this path
    D:\dlib-19.2\dlib-19.2
    as Include Directories.

  4. Downloaded
    shape_predictor_68_face_landmarks.dat
    file.

  5. In the command line argument 'shape_predictor_68_face_landmarks.dat download.jpg' here shape_predictor_68_face_landmarks.dat i have added in project folder and download.jpg is my image file .

  6. Added
    dlib/external
    folder to project.

  7. Added
    #define DLIB_JPEG_SUPPORT



questions: so many errors in file and not able to understand what is happening.
enter image description here

Answer

Your project is not inheriting the include directorys. I think you set "D:\dlib-19.2\dlib-19.2" as the only include dir. Errors like "cannot open source file string" are not related to your code, they are related to your project settings.

VC2015

Also note:

Again, note that you should not add the dlib folder itself to your compiler's include path. Doing so will cause the build to fail because of name collisions (e.g. dlib/string.h with string.h from the standard library). Instead you should add the folder that contains the dlib folder to your include search path and then use include statements of the form #include . This will ensure that everything builds correctly.