Kaydet (Commit) c55ae4b9 authored tarafından Fred Drake's avatar Fred Drake

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.
üst 3b959dbc
...@@ -14,6 +14,17 @@ building extension modules, instead of the one described in this ...@@ -14,6 +14,17 @@ building extension modules, instead of the one described in this
section. You will still need the C compiler that was used to build section. You will still need the C compiler that was used to build
Python; typically Microsoft Visual \Cpp. Python; typically Microsoft Visual \Cpp.
\begin{notice}
This chapter mentions a number of filenames that include an encoded
Python version number. These filenames are represented with the
version number shown as \samp{XY}; in practive, \character{X} will
be the major version number and \character{Y} will be the minor
version number of the Python release you're working with. For
example, if you are using Python 2.2.1, \samp{XY} will actually be
\samp{22}.
\end{notice}
\section{A Cookbook Approach \label{win-cookbook}} \section{A Cookbook Approach \label{win-cookbook}}
There are two approaches to building extension modules on Windows, There are two approaches to building extension modules on Windows,
...@@ -167,11 +178,11 @@ Hello, world ...@@ -167,11 +178,11 @@ Hello, world
Select ``Win32 Release'' in the ``Settings for'' dropdown list. Select ``Win32 Release'' in the ``Settings for'' dropdown list.
Click the Link tab, choose the Input Category, and append Click the Link tab, choose the Input Category, and append
\code{python22.lib} to the list in the ``Object/library modules'' \code{pythonXY.lib} to the list in the ``Object/library modules''
box. box.
Select ``Win32 Debug'' in the ``Settings for'' dropdown list, and Select ``Win32 Debug'' in the ``Settings for'' dropdown list, and
append \code{python22_d.lib} to the list in the ``Object/library append \code{pythonXY_d.lib} to the list in the ``Object/library
modules'' box. Then click the C/\Cpp{} tab, select ``Code modules'' box. Then click the C/\Cpp{} tab, select ``Code
Generation'' from the Category dropdown list, and select ``Debug Generation'' from the Category dropdown list, and select ``Debug
Multithreaded DLL'' from the ``Use run-time library'' dropdown Multithreaded DLL'' from the ``Use run-time library'' dropdown
...@@ -275,19 +286,19 @@ Windows Python is built in Microsoft Visual \Cpp; using other ...@@ -275,19 +286,19 @@ Windows Python is built in Microsoft Visual \Cpp; using other
compilers may or may not work (though Borland seems to). The rest of compilers may or may not work (though Borland seems to). The rest of
this section is MSV\Cpp{} specific. this section is MSV\Cpp{} specific.
When creating DLLs in Windows, you must pass \file{python15.lib} to When creating DLLs in Windows, you must pass \file{pythonXY.lib} to
the linker. To build two DLLs, spam and ni (which uses C functions the linker. To build two DLLs, spam and ni (which uses C functions
found in spam), you could use these commands: found in spam), you could use these commands:
\begin{verbatim} \begin{verbatim}
cl /LD /I/python/include spam.c ../libs/python15.lib cl /LD /I/python/include spam.c ../libs/pythonXY.lib
cl /LD /I/python/include ni.c spam.lib ../libs/python15.lib cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib
\end{verbatim} \end{verbatim}
The first command created three files: \file{spam.obj}, The first command created three files: \file{spam.obj},
\file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain \file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain
any Python functions (such as \cfunction{PyArg_ParseTuple()}), but it any Python functions (such as \cfunction{PyArg_ParseTuple()}), but it
does know how to find the Python code thanks to \file{python15.lib}. does know how to find the Python code thanks to \file{pythonXY.lib}.
The second command created \file{ni.dll} (and \file{.obj} and The second command created \file{ni.dll} (and \file{.obj} and
\file{.lib}), which knows how to find the necessary functions from \file{.lib}), which knows how to find the necessary functions from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment