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

Skip to content

Commit c55ae4b

Browse files
committed
Clean up the use of version numbers in filenames; always use an "abstract"
version number, and explain what it is at the top of the chapter. This closes SF bug #225003.
1 parent 3b959db commit c55ae4b

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

Doc/ext/windows.tex

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ \chapter{Building C and \Cpp{} Extensions on Windows%
1414
section. You will still need the C compiler that was used to build
1515
Python; typically Microsoft Visual \Cpp.
1616

17+
\begin{notice}
18+
This chapter mentions a number of filenames that include an encoded
19+
Python version number. These filenames are represented with the
20+
version number shown as \samp{XY}; in practive, \character{X} will
21+
be the major version number and \character{Y} will be the minor
22+
version number of the Python release you're working with. For
23+
example, if you are using Python 2.2.1, \samp{XY} will actually be
24+
\samp{22}.
25+
\end{notice}
26+
27+
1728
\section{A Cookbook Approach \label{win-cookbook}}
1829

1930
There are two approaches to building extension modules on Windows,
@@ -167,11 +178,11 @@ \section{A Cookbook Approach \label{win-cookbook}}
167178

168179
Select ``Win32 Release'' in the ``Settings for'' dropdown list.
169180
Click the Link tab, choose the Input Category, and append
170-
\code{python22.lib} to the list in the ``Object/library modules''
181+
\code{pythonXY.lib} to the list in the ``Object/library modules''
171182
box.
172183

173184
Select ``Win32 Debug'' in the ``Settings for'' dropdown list, and
174-
append \code{python22_d.lib} to the list in the ``Object/library
185+
append \code{pythonXY_d.lib} to the list in the ``Object/library
175186
modules'' box. Then click the C/\Cpp{} tab, select ``Code
176187
Generation'' from the Category dropdown list, and select ``Debug
177188
Multithreaded DLL'' from the ``Use run-time library'' dropdown
@@ -275,19 +286,19 @@ \section{Using DLLs in Practice \label{win-dlls}}
275286
compilers may or may not work (though Borland seems to). The rest of
276287
this section is MSV\Cpp{} specific.
277288

278-
When creating DLLs in Windows, you must pass \file{python15.lib} to
289+
When creating DLLs in Windows, you must pass \file{pythonXY.lib} to
279290
the linker. To build two DLLs, spam and ni (which uses C functions
280291
found in spam), you could use these commands:
281292

282293
\begin{verbatim}
283-
cl /LD /I/python/include spam.c ../libs/python15.lib
284-
cl /LD /I/python/include ni.c spam.lib ../libs/python15.lib
294+
cl /LD /I/python/include spam.c ../libs/pythonXY.lib
295+
cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib
285296
\end{verbatim}
286297

287298
The first command created three files: \file{spam.obj},
288299
\file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain
289300
any Python functions (such as \cfunction{PyArg_ParseTuple()}), but it
290-
does know how to find the Python code thanks to \file{python15.lib}.
301+
does know how to find the Python code thanks to \file{pythonXY.lib}.
291302

292303
The second command created \file{ni.dll} (and \file{.obj} and
293304
\file{.lib}), which knows how to find the necessary functions from

0 commit comments

Comments
 (0)