This is a just a quick-and-dirty example of a simple Python native extension on Windows for my personal reference. The lessons learned here will be used for my Python Onyx32 extension. It is mostly based on documentation from Microsoft.
To run this repo, you'll need:
- Install VS Community 2019 with "Desktop Development with C++" and "Python development" workloads.
- With the Python workload, you'll need miniconda (for creating a virtual environment), Python native development tools, and a Python 3 64-bit environment.
- Make note of where VS installs your Python environment (on my machine, VS installed Python into A:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64).
- Set the build to x64 and configuration to Release when opening the Solution.
- Create an x64 Python 3 environment named
env
in VS under PythonExtension project > Python Environments. - In the superfast project's properties, you'll also need to:
- Update VC++ Directories > Include Directories to the location of your Python installation's (as per above) include folder.
- Update Linker > Additional Library Directories to the location of your Python installation's lib folder.