CMake error when compiling: Python is 32-bit, chosen compiler is 64-bit

I’m trying to build the KiCad 7.0 branch for Windows using Visual Studio 2022. I’m following these instructions: Windows (Visual Studio) | Developer Documentation | KiCad

I’m stuck at step “3. Configure paths to SWIG” where CMake configuration should now succeed, showing “CMake generation finished”.

I’ve chosen the Configuration to be x64-Debug, and I’m using swigwin-4.1.1.

This is a fresh install, so I have the latest version of vcpkg and Visual Studio.

After adding the CMake Command Argument “-DSWIG_EXECUTABLE=C:\dev\swigwin-4.1.1\swig.exe” and saving, CMake gives me this error:

Error: CMake Error at thirdparty/pybind11/tools/FindPythonLibsNew.cmake:176 (message): Python config failure: Python is 32-bit, chosen compiler is 64-bit
C:\dev\kicad\thirdparty/pybind11/tools/FindPythonLibsNew.cmake 176

It seems to be configured for 64-bit compilation, but for some reason it finds a 32-bit version Python??

I tried x86-Debug Configuration instead, but that gives me a different error:

Error: CMake Error at cmake/FindwxPython.cmake:56 (message):
wxPython/Phoenix does not appear to be installed on the system C:\dev\kicad\cmake/FindwxPython.cmake 56

What does vcpkg list python show? this is irrelevant.

Do you have some other python executable on path?

I did, but it was 64-bit. I just uninstalled python and started over. I’ll give it another try.

The python I had was:
C:\Users\denne>python
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32

Progress!!

1> [CMake] – Configuring done
1> [CMake] – Generating done
1> [CMake] – Build files have been written to: C:/dev/kicad/build/x64-Debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.

Thanks a lot @qu1ck !

Keep in mind, debug configuration is unusably slow. Unless you are doing development and need to actively debug code I suggest you switch to Release or RelWithDebugInfo config.

Thanks for the tip!

I probably don’t need debug but it may be nice to have. Almost two years ago a guy helped me to add an importer for TinyCad schematics (open source Windows application for drawing schematics). I’m having some problems with the version I built then (based on 5.99). I’m going to try compiling that importer using 7.0.2 as a base and hopefully fix my problems. Since TinyCad doesn’t seem to have that many users, and since I’m not capable of maintaining this importer, I haven’t issued a merge request for it.

I just managed to compile Eeschema! :smiley: Now I can start working.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.