Kaydet (Commit) 0d448e0e 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 c26bc803
......@@ -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
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}}
There are two approaches to building extension modules on Windows,
......@@ -167,11 +178,11 @@ Hello, world
Select ``Win32 Release'' in the ``Settings for'' dropdown list.
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.
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
Generation'' from the Category dropdown list, and select ``Debug
Multithreaded DLL'' from the ``Use run-time library'' dropdown
......@@ -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
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
found in spam), you could use these commands:
\begin{verbatim}
cl /LD /I/python/include spam.c ../libs/python15.lib
cl /LD /I/python/include ni.c spam.lib ../libs/python15.lib
cl /LD /I/python/include spam.c ../libs/pythonXY.lib
cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib
\end{verbatim}
The first command created three files: \file{spam.obj},
\file{spam.dll} and \file{spam.lib}. \file{Spam.dll} does not contain
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
\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