I've been compiling a C library, and linking in the Python3 lib files for Python bindings. I've been using the python39.lib file as the link, but I was wondering what the difference is between the 'versioned' number (e.g. python3x.lib) vs the non versioned one (python3.lib).
In answer to a question, forgot to mention that this is compiling on windows using gcc.
Thanks
python3.lib
only contains key library functions used by cpython program (or C extension for Python).python3x.lib
(such aspython38.lib
,python39.lib
) contains the full library functions. You should link topython3.lib
so that your build configuration is not affected by minor Python version upgrade such as from 3.8 to 3.9.The linking is very platform and compiler dependent. See code comment in the
PC/pyconfig.h
(See reference [3]).Additional info