Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cd70c3

Browse files
committed
Instructions updated for 1.5. Added the important note to set the
run-library to multithreaded dll.
1 parent 201afe5 commit 8cd70c3

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

PC/example_nt/readme.txt

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
1-
*** WARNING -- THIS DIRECTORY IS OUT OF DATE.
2-
*** It has not been updated since Python 1.4beta3.
3-
4-
51
Example Python extension for Windows NT
62
=======================================
73

84
This directory contains everything you need to build a Python
95
extension module using Microsoft VC++ 4.x ("Developer Studio"), except
10-
for the Python distribution. It has only been tested with version
11-
4.0, but should work with higher versions.
12-
13-
The "example" subdirectory should be an immediate subdirectory of the
14-
Python source directory -- a direct sibling of Include and PC, in
15-
particular, which are referenced as "..\Include" and "..\PC".
16-
In other words, it should *not* be used "as is". Copy or move it up
17-
one level or you will regret it! (This is done to keep all the PC
6+
for the Python distribution. It has been tested most recently with
7+
version 4.2.
8+
9+
The "example_nt" subdirectory should be an immediate subdirectory of
10+
the Python source directory -- a direct sibling of Include and PC, in
11+
particular, which are referenced as "..\Include" and "..\PC". In
12+
other words, it should *not* be used "as is". Copy or move it up one
13+
level or you will regret it! (This is done to keep all the PC
1814
specific files inside the PC subdirectory of the distribution, where
1915
they belong.)
2016

2117
It is also assumed that the build results of Python are in the
22-
directory ..\vc40. In particular, the python14.lib file is referred
23-
to as "..\vc40\python14.lib".
18+
directory ..\vc40. In particular, the python15.lib file is referred
19+
to as "..\vc40\python15.lib".
2420

2521
In order to use the example project from Developer Studio, use the
2622
"File->Open Workspace..." dialog (*not* the "File->Open..." dialog!).
@@ -63,7 +59,7 @@ Python interface).
6359

6460
Now your options are:
6561

66-
1) Clone example.mak. Start by copying example\example.mak to
62+
1) Clone example.mak. Start by copying example_nt\example.mak to
6763
spam\spam.mak. Do a global edit on spam.mak, replacing all
6864
occurrences of the string "example" by "spam", and all occurrences of
6965
"DEP_CPP_EXAMP" by something like "DEP_CPP_SPAM". You can now use
@@ -72,9 +68,9 @@ this makefile to create a project file by opening it as a workspace
7268

7369
2) Create a brand new project; instructions are below.
7470

75-
In both cases, copy example\example.def to spam\spam.def, and edit
76-
spam\spam.def so its second line contains the string "initspam".
77-
If you created a new project yourself, add the file spam.def to the
71+
In both cases, copy example_nt\example.def to spam\spam.def, and edit
72+
spam\spam.def so its second line contains the string "initspam". If
73+
you created a new project yourself, add the file spam.def to the
7874
project now.
7975

8076
You are now all set to build your extension, unless it requires other
@@ -97,17 +93,24 @@ Win32 as the platform (in my version, this is the only choice). Click
9793

9894
Now open the "Build->Settings..." dialog. (Impressive, isn't it? :-)
9995
You only need to change a few settings. Make sure you have both the
100-
Debug and the Release configuration selected when you make these
101-
changes. Select the "C/C++" tab. Choose the "Preprocessor" category
96+
Debug and the Release configuration selected when you make the first
97+
change. Select the "C/C++" tab. Choose the "Preprocessor" category
10298
in the popup menu at the top. Type the following text in the entry
10399
box labeled "Addditional include directories:"
104100

105101
..\Include,..\PC
106102

103+
You must also change the run-time library. This must be done
104+
separately for the Release and Debug configurations. Choose the "Code
105+
Generation" category in the C/C++ tab. In the box labeled "Use
106+
run-time library", choose "Multithreaded DLL" for the Release
107+
configuration, and "Debug Multithreaded DLL" for the Debug
108+
configuration. That's all.
109+
107110
You should now first create the file spam.def as instructed in the
108111
previous section.
109112

110113
Now chose the "Insert->Files into Project..." dialog. Set the pattern
111114
to *.* and select both spam.c and spam.def and click OK. (Inserting
112115
them one by one is fine too.) Using the same dialog, choose the file
113-
..\vc40\python14.lib and insert it into the project.
116+
..\vc40\python15.lib and insert it into the project.

0 commit comments

Comments
 (0)