System environment: VC6 + Python-2.5.4
1, download Python-2.5.4 source code.
2, decompression, open D:\Python-2.5.4\PC\VC6\pcbuild.dsw, compile, D:\Python-2.5.4\PC\VC6\ under Python25.dll, Python25_d.dll, Python25.lib, Python25_d.lib.
3, use VC6 to establish a dynamic link library project, copy the D:\Python-2.5.4\PC\example_nt\example.c to the project directory, and add to the project.
4, set up the project.
The code is as follows:
Open tools->options->directories, add D:\PYTHON-2.5.4\INCLUDE to includes files, add D:\PYTHON-2.5.4\PC\VC6 to Library Files.
Open progect->settings, change Win32 debug->link->output file name to Example_d.pyd, Win32 release->link-> Output file name modified to Example.pyd
5, compile.
6. Try calling:
The code is as follows:
D:\MY Project\testpymodule\release>python
Python 2.5.4 (r254:67916, Dec, 15:10:54) [MSC v.1310 + bit (Intel)] on
Win32
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Example
>>> Example.foo ()
Hello, World
>>>