Jpeg files to download dlib

I am trying to implement a program using the dlib library. I have already been able to use dlib with all other files except those related to jpeg and png.

#include "dlib\image_io.h" #define DLIB_JPEG_SUPPORT int main(){ dlib::array2d<dlib::rgb_pixel> arr1; dlib::load_jpeg(arr1,"sailboat1234.jpeg"); } 

I included the source.cpp file and those that are inside dlib/external in my project. I also included in C ++ the dlib-18.11 shared folder, which contains the dlib folder. Finally, the project runs on Visual studio 2012.

EDIT:

When I run the program, the error: error C2027: use of undefined type 'dlib::compile_time_assert<value>' . Any ideas?

+5
source share
1 answer

You need to put the definition in front of the headers so that it has some effect:

 #define DLIB_JPEG_SUPPORT #include "dlib\image_io.h" 

For reference, see this header:

 image_loader\jpeg_loader.h 
0
source

Source: https://habr.com/ru/post/1210489/


All Articles