Page MenuHomePhabricator

OpenCV 3.4.1 doesn't compile with Python 3 on Windows with VS 2017
Closed, ResolvedPublic

Description

Seems to be fixed in OpenCV 3.4.2.

Revisions and Commits

Event Timeline

kislinsk triaged this task as Normal priority.Aug 28 2018, 1:33 PM
kislinsk created this task.

Compiles now but cannot link to python37.lib. This is because of the value of PYTHON3_LIBRARY in the CMake cache of OpenCV-build: optimized;optimized;debug;C:/Python37/libs/python37_d.lib. This should be simply C:/Python37/libs/python37_d.lib instead. PYTHON3_LIBRARY_DEBUG is set correctly.

Possible solution: Instead of passing PYTHON_LIBRARY to the external project, try to pass PYTHON3_LIBRARY. If it gets overridden, pass it as CMAKE_CACHE_ARGS instead of CMAKE_ARGS in CMakeExternals/OpenCV.cmake. This way OpenCV shouldn't be able to override this value anymore.

One has to understand how OpenCV-build/cmake/OpenCVDetectPython.cmake works to fix this issue I guess.

Since we use system python we do not need to build the opencv python bindings.

The same is true for vtk by the way

neher added a revision: Restricted Differential Revision.Aug 31 2018, 4:21 PM