Visual Studio 2008 Express Project Settings for Python C Extension
Here are some notes for setting up VS 2008 Express C++ project for Python extension development. For detailed information, you should check out the official document.
Project type
Choose Visual C++->Win32->Win32 Project. The recommended project folder should be your Python source code folder.
Application settings
In the application wizard, choose Application type: DLL. And check the box for “Empty project”.**
**
Project properties
First choose Configuration->All Configurations. In Configuration Properties->Linker->Command Line, add this into Additional options textbox:
`Here are some notes for setting up VS 2008 Express C++ project for Python extension development. For detailed information, you should check out the official document.
Project type
Choose Visual C++->Win32->Win32 Project. The recommended project folder should be your Python source code folder.
Application settings
In the application wizard, choose Application type: DLL. And check the box for “Empty project”.**
**
Project properties
First choose Configuration->All Configurations. In Configuration Properties->Linker->Command Line, add this into Additional options textbox:
`
(for example, if the function name is initspam, this line should be /export:initspam)
Then choose Debug configuration. In Configuration Properties->C/C++->General, added the following two folder into Additional Include Directories (only if you created your project in the Python source code folder):
- ....\Include
- ....\PC
In Configuration Properties->Linker->General, change Output File to
$(OutDir)\$(ProjectName)_d.pyd
Additional Library Directories
..\..\PCbuild
Finally, in Properties->Linker->Input, add Additional Dependencies
python27_d.lib
That’s it, you are done! Release configuration is almost the same just don’t forget to remove _d for output file and additional dependencies.