dlib vs2015编译 测试
使用cmake生成文档
使用vs2015编译,成功,静态库
使用demo测试
#include "stdafx.h"
#include "dlib\image_processing\frontal_face_detector.h"
#include "dlib\image_io.h"
using namespace dlib;
void TestFaceDetect(const char *filename)
{
frontal_face_detector detector = get_frontal_face_detector();
array2d<unsigned char> img;
load_image(img, filename);
std::vector<rectangle> dets = detector(img);
printf("Number of face detected:%d\n", dets.size());
}
int main()
{
const char *filename = "C://Users//lenovo//Pictures//test2.png";
TestFaceDetect(filename);
system("pause");
return 0;
}
报错:
>dlibTest.obj : error LNK2019: 无法解析的外部符号 dgesdd_,该符号在函数 "long __cdecl dlib::lapack::binding::gesdd(char,long,long,double *,long,double *,double *,long,double *,long,double *,long,long *)" (?gesdd@binding@lapack@dlib@@YAJDJJPEANJ00J0J0JPEAJ@Z) 中被引用
1>dlibTest.obj : error LNK2019: 无法解析的外部符号 dgesvd_,该符号在函数 "long __cdecl dlib::lapack::binding::gesvd(char,char,long,long,double *,long,double *,double *,long,double *,long,double *,long)" (?gesvd@binding@lapack@dlib@@YAJDDJJPEANJ00J0J0J@Z) 中被引用
1>dlibTest.obj : error LNK2019: 无法解析的外部符号 cblas_saxpy,该符号在函数 "void __cdecl dlib::blas_bindings::cblas_axpy(int,float,float const *,int,float *,int)" (?cblas_axpy@blas_bindings@dlib@@YAXHMPEBMHPEAMH@Z) 中被引用
1>dlibTest.obj : error LNK2019: 无法解析的外部符号 cblas_sscal,该符号在函数 "void __cdecl dlib::blas_bindings::cblas_scal(int,float,float *)" (?cblas_scal@blas_bindings@dlib@@YAXHMPEAM@Z) 中被引用
搜了下,找到这个:
https://blog.csdn.net/D206_hero/article/details/80002237
说是缺少依赖库,用everything搜索了下libopenblas.lib, 确实有,把库和头文件引入工程
再次编译,依然错误:
dlibTest.obj : error LNK2019: 无法解析的外部符号 dgesdd_,该符号在函数 "long __cdecl dlib::lapack::binding::gesdd(char,long,long,double *,long,double *,double *,long,double *,long,double *,long,long *)" (?gesdd@binding@lapack@dlib@@YAJDJJPEANJ00J0J0JPEAJ@Z) 中被引用
1>dlibTest.obj : error LNK2019: 无法解析的外部符号 dgesvd_,该符号在函数 "long __cdecl dlib::lapack::binding::gesvd(char,char,long,long,double *,long,double *,double *,long,double *,long,double *,long)" (?gesvd@binding@lapack@dlib@@YAJDDJJPEANJ00J0J0J@Z) 中被引用
应该是确实lapack库,不想编译lapack了,打开cmake,去除DLIB_USE_LAPACK,生成工程,重新编译
ok,没问题了
debug库真的很慢