ITK wrap python compile error

I want to compile ITK from source and wrap with python. But the following bug happen:

My environment is:
window 10 64 bit
vs 2015 64 bit
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
cmake 3.16.0-rc4

Any suggestion is appreciated!

You need 64-bit Python. Also answered on GitHub.

Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] ::

This means it is a 64 bit Python.

LNK111: module machine ‘x64’ conflicts with target machine type ‘X86’

This means that the ITK Visual Studio is building for 32-bit system: since we are building against 64 bit Python, we want to build for a 64-bit system.

Delete the ITK build tree, then run the initial CMake configuration again. On the first CMake configuration, the target build generator is selected; change to a 64-bit Visual Studio generator.

LNK110: cannot open file ‘python37_d.lib’

This indicates a debug build and linking against the _d debug library; you probably do not want that. Select the Release versus the Debug build configuration in Visual Studio. Also, check the PYTHON_LIBRARY setting in the CMake configuration and make sure it is not pointing to the _d library.

1 Like