默认情况下,cmake似乎使用的生成器与平台支持的生成器不同。在您的cmd中,键入cmake help。这将打印一个发电机列表供选择,我的如下所示:The following generators are available on this platform:
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be "Win64" or "IA64".
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be "Win64" or "IA64".
确保您还有Visual Studio 15 ...行。然后您应该能够运行您的安装:获取源代码,例如v19.17
解压缩,并在解压缩的源文件夹中打开cmd
运行python setup.py -G Visual Studio 15 2017 Win64
这应该告诉cmake使用正确的visual studio生成器。在
另外值得一提的是,既然您似乎在使用Python,那么dlib应该可以从conda-forge获得,并且可以像这样安装:
^{pr2}$