Dlib failed to build due to many errors: error C2065 and C2338
I tried to build Dlib on Windows with VS2017 Update2. It failed to build due to many errors: such as error C2065, C2338 or MSB6003. Could you please help take a look at this? Thank you!
Expected Behavior
Build successfully.
Current Behavior
running install running bdist_egg running egg_info writing tools/python\dlib.egg-info\PKG-INFO writing dependency_links to tools/python\dlib.egg-info\dependency_links.txt writing top-level names to tools/python\dlib.egg-info\top_level.txt package init file 'tools\python\dlib_init_.py' not found (or not a regular file) reading manifest file 'tools/python\dlib.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'tools\python\build*' adding license file 'LICENSE.txt' writing manifest file 'tools/python\dlib.egg-info\SOURCES.txt' installing library code to build\bdist.win32\egg running install_lib running build_py running build_ext Building extension for Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\agust\Downloads\dlib-19.22\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\agust\Downloads\dlib-19.22\build\lib.win32-3.10 -DPYTHON_EXECUTABLE=C:\Users\agust\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\agust\Downloads\dlib-19.22\build\lib.win32-3.10 -A x64' -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000. -- pybind11 v2.2.4 -- Using CMake version: 3.22.0 -- Compiling dlib version: 19.22.0 -- SSE4 instructions can be executed by the host processor. -- AVX instructions can be executed by the host processor. -- Enabling AVX instructions -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: C:/Users/agust/Downloads/dlib-19.22/build/temp.win32-3.10/Release Invoking CMake build: 'cmake --build . --config Release -- /m' Microsoft (R) Build Engine versión 16.11.2+f32259642 para .NET Framework Copyright (C) Microsoft Corporation. Todos los derechos reservados.
Checking Build System
Building Custom Rule C:/Users/agust/Downloads/dlib-19.22/dlib/CMakeLists.txt
dlib.vcxproj -> C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release\dlib_build\Release\dlib19.22.0_release_64bit_msvc1929.lib
Building Custom Rule C:/Users/agust/Downloads/dlib-19.22/tools/python/CMakeLists.txt
dlib.cpp
matrix.cpp
vector.cpp
svm_c_trainer.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\dlib.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\dlib.cpp) [C:\Users\agust
\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\vector.cpp
) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\vector.cpp) [C:\Users\agu
st\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\matrix.cpp
) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\matrix.cpp) [C:\Users\agu
st\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_c_trai
ner.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_c_trainer.cpp) [C:\Us
ers\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
svm_rank_trainer.cpp
decision_functions.cpp
other.cpp
basic.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_rank_t
rainer.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_rank_trainer.cpp) [C:
\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\decision_f
unctions.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\decision_functions.cpp) [
C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\other.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\other.cpp) [C:\Users\agus
t\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\basic.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\basic.cpp) [C:\Users\agus
t\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
cca.cpp
sequence_segmenter.cpp
svm_struct.cpp
image.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\cca.cpp) [
C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\cca.cpp) [C:\Users\agust
Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\sequence_s
egmenter.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\sequence_segmenter.cpp) [
C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_struct
.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\svm_struct.cpp) [C:\Users
\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image.cpp) [C:\Users\agus
t\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
image2.cpp
image3.cpp
image4.cpp
rectangles.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image2.cpp
) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image2.cpp) [C:\Users\agu
st\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image3.cpp
) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image3.cpp) [C:\Users\agu
st\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image4.cpp
) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image4.cpp) [C:\Users\agu
st\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\rectangles
.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\rectangles.cpp) [C:\Users
\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
object_detection.cpp
shape_predictor.cpp
correlation_tracker.cpp
face_recognition.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\object_det
ection.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\object_detection.cpp) [C:
\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\shape_pred
ictor.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\shape_predictor.cpp) [C:
Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\correlatio
n_tracker.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\correlation_tracker.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\face_recog
nition.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\face_recognition.cpp) [C:
\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
cnn_face_detector.cpp
global_optimization.cpp
image_dataset_metadata.cpp
numpy_returns.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\cnn_face_d
etector.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\cnn_face_detector.cpp) [C
:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\global_opt
imization.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\global_optimization.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image_data
set_metadata.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\image_dataset_metadata.cp
p) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
line.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\numpy_retu
rns.cpp) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\numpy_returns.cpp) [C:\Us
ers\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
gui.cpp
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\line.cpp)
[C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\line.cpp) [C:\Users\agust
\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,22): error C2065: 'ssize_t': identificador no declarado (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\gui.cpp) [
C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h(35,31): error C2338: ssize_t != Py_intptr_t (compilando archivo de origen C:\Users\agust\Downloads\dlib-19.22\tools\python\src\gui.cpp) [C:\Users\agust
Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: No se pudo ejecutar la tarea ejecutable especificada "CL.exe". System.IO.IOException: El proceso
no puede obtener acceso al archivo 'C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.dir\Release_dlib_pybind11.tlog' porque está siendo utilizado en otro proceso. [C:\Users\agust\Downloads\dlib-19.22\bu
ild\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en System.IO._Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\agust\Downlo
ads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en System.IO.FileSystemEnumerableIterator1.CommonInit() [C:\Users\agust\Downloads\dlib-19.22
\build\temp.win32-3.10\Release\_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, Strin
g searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en System.IO.Directory.GetFiles(String path, String searchPattern) [C:\Users\agust\Downloads
dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\User
s\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.Utilities.CanonicalTrackedInputFiles.InternalConstruct(ITask ownerTask, IT
askItem[] tlogFiles, ITaskItem[] sourceFiles, ITaskItem[] outputFiles, ITaskItem[] excludedInputPaths, CanonicalTrackedOutputFiles outputs, Boolean useMinimalRebuildOptimization, Boolean maintainCompositeRootingMarkers) [C:\Users\agust
Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.Utilities.CanonicalTrackedInputFiles..ctor(ITaskItem[] tlogFiles, ITaskIte
m[] sourceFiles, ITaskItem[] excludedInputPaths, CanonicalTrackedOutputFiles outputs, Boolean useMinimalRebuildOptimization, Boolean maintainCompositeRootingMarkers) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dl
ib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\agust\Downloads\dlib
-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseF
ileCommands, String commandLineCommands) [C:\Users\agust\Downloads\dlib-19.22\build\temp.win32-3.10\Release_dlib_pybind11.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(687,5): error MSB6003: en Microsoft.Build.Utilities.ToolTask.Execute() [C:\Users\agust\Downloads\dlib-19.22\build\te
mp.win32-3.10\Release_dlib_pybind11.vcxproj]
Traceback (most recent call last):
File "C:\Users\agust\Downloads\dlib-19.22\setup.py", line 222, in
A lot of these errors are due to ssize_t being undefined. You can fix this by editing C:\Users\agust\Downloads\dlib-19.22\dlib\external\pybind11\include\pybind11/numpy.h
Find these lines of code near the top of the file after the #include statements:
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif
Change to:
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
This will provide a definition for ssize_t and allow the compiler to continue I had this problem too. After the change above, dlib built with no issues.
Hope this helps
The better solution might be to use Py_ssize_t instead of ssize_t in numpy.h. (As this is a python only file, there are noch compatability issues with the rest of the library)
Other libraries have faced the same issue: https://github.com/jpype-project/jpype/issues/1009
Warning: this issue has been inactive for 35 days and will be automatically closed on 2022-01-28 if there is no further activity.
If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.
Warning: this issue has been inactive for 43 days and will be automatically closed on 2022-01-28 if there is no further activity.
If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.
@davisking can you make new release? Latest release is 3 days before this patch, so it still fails for regular folks who do pip install dlib.
Done :)
updating to pybind11 v2.14.0 resolved C2065 and C2338 errors with python 3.11.9