1. 第一神坑,dlib只支持vs2017以前版本,最新的vs2019不能直接编译,因此建议安装vs2017。具体支持的编译器参见下图
如果安装了vs2017则可直接执行python setup.py install 安装成功。而作者之前机子上安装的vs2019,执行python setup.py install 之后,一直报错不能该编译器不能编译简单文件。
2.对于习惯使用g++的同学,请安装mingw,具体配置如下
请记住: Architercture请和你的电脑一致,64位的机子尽量选择x86_64.
Threads必须选择posix模式,因为dlib只支持该模式。
exception必须选择sjlj模式,否则会报mutex相关的错
3. error: '::hypot' has not been declared
编译到百分83时,报错'hypot' has not been declared
错误原因:在pyconfig的header file中,hypot被重命名为_hypot,二cmath调用的时hypot。
解决方法:在python安装路径下的include文件中找到Python.h(我的路径是C:\Users\goodxin\Anaconda3\include\Python.h), 在python.h的#define下一行加入#include "math.h"即可。