Dlib使用过程全记录(二)
使用的环境: VS2015 + win7
使用dlib的方法: Compiling on Windows Using Visual Studio 2015 or Newer (来自官网)
官网的原文:
All you need to do is create an empty console project. Then add dlib/all/source.cpp to it and add the folder containing the dlib folder to the #include search path. Then you can compile any example program by adding it to your project.
Again, note that dlib will only be able to work with jpeg and png files if you link in libjpeg and libpng. In Visual Studio, the easiest way to do this is to add all the libjpeg, libpng, and zlib source files in the dlib/external folder into your project and also define the DLIB_PNG_SUPPORT and DLIB_JPEG_SUPPORT preprocessor directives. If you don't know how to configure Visual Studio then you should use CMake as shown above since it will take care of everything automatically.
我的操作步骤:
1、建立一个空的C++ 控制台工程;
2、把dlib 放到工程目录下;
3、把dlib/all/source.cpp添加到工程(敲黑板,划重点,这步很重要,很重要);
4、修改属性里的 #Additional Library Directories,增加dlib的上层目录,因为我们examples 里的头文件是#include <dlib/**.h>的形式。
5、把examples里的cpp加进来,跑一下。
编译没问题,我遇到了.dll找不到问题,慢慢加进来好了。
查看缺失 dll 的一个工具: DependencyWalker