This section outlines the steps to build a Python binding wrapper for ADLX, a prerequisite to programming with ADLX in a Python application.
ADLX SDK is installed.
Visual Studio 2019 is installed.
Python 3.9 is installed.
pybind11 is installed.
The path to the Python 3.9 installation is added to the PYHOME system environment variable.
Create a folder for your Python ADLX binding wrapper, for example
Create a new file in the
ADLXPybindfolder and title it
bind.cppand bind the interfaces you wish to wrap using
pybind11. To create bindings for event notifications, inherit the respective listener interface.
For example, inherit IADLXDisplayListChangedListener .
Note: Refer to the Python samples bind.cpp file for an example of a Python binding.
Create a C++ Dynamic Link Library project named
ADLXPybindand configure the project as follows:
Advanced > Target File Extension
Use .pyd as the extension
VC++ Directories > Include Directories
$(PYHOME)/include , $(PYHOME)/Lib/site-packages/pybind11/include,
Add Path of python include and path of pybind11 include
VC++ Directories > Library Directories
Add path of python libs
C/C++ > Precompiled Header
Not Using Precompiled Headers
Do not use precompiled headers
Linker > Inpit
Add python lib
bind.cppfile to the project
Add the following files to the project:
Build the project.
ADLXPybind.pydis built in the