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

Skip to content

Commit 4985ff2

Browse files
committed
#9086: correct wrong terminology about linking with pythonXY.dll.
1 parent 531d76b commit 4985ff2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Doc/faq/windows.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,18 @@ Embedding the Python interpreter in a Windows app can be summarized as follows:
290290

291291
1. Do _not_ build Python into your .exe file directly. On Windows, Python must
292292
be a DLL to handle importing modules that are themselves DLL's. (This is the
293-
first key undocumented fact.) Instead, link to :file:`python{NN}.dll`; it is
294-
typically installed in ``C:\Windows\System``. NN is the Python version, a
293+
first key undocumented fact.) Instead, link to :file:`python{NN}.dll`; it is
294+
typically installed in ``C:\Windows\System``. *NN* is the Python version, a
295295
number such as "23" for Python 2.3.
296296

297-
You can link to Python statically or dynamically. Linking statically means
298-
linking against :file:`python{NN}.lib`, while dynamically linking means
299-
linking against :file:`python{NN}.dll`. The drawback to dynamic linking is
300-
that your app won't run if :file:`python{NN}.dll` does not exist on your
301-
system. (General note: :file:`python{NN}.lib` is the so-called "import lib"
302-
corresponding to :file:`python.dll`. It merely defines symbols for the
303-
linker.)
297+
You can link to Python in two different ways. Load-time linking means
298+
linking against :file:`python{NN}.lib`, while run-time linking means linking
299+
against :file:`python{NN}.dll`. (General note: :file:`python{NN}.lib` is the
300+
so-called "import lib" corresponding to :file:`python.dll`. It merely
301+
defines symbols for the linker.)
304302

305-
Linking dynamically greatly simplifies link options; everything happens at
306-
run time. Your code must load :file:`python{NN}.dll` using the Windows
303+
Run-time linking greatly simplifies link options; everything happens at run
304+
time. Your code must load :file:`python{NN}.dll` using the Windows
307305
``LoadLibraryEx()`` routine. The code must also use access routines and data
308306
in :file:`python{NN}.dll` (that is, Python's C API's) using pointers obtained
309307
by the Windows ``GetProcAddress()`` routine. Macros can make using these
@@ -312,6 +310,8 @@ Embedding the Python interpreter in a Windows app can be summarized as follows:
312310
Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf.exe
313311
first.
314312

313+
.. XXX what about static linking?
314+
315315
2. If you use SWIG, it is easy to create a Python "extension module" that will
316316
make the app's data and methods available to Python. SWIG will handle just
317317
about all the grungy details for you. The result is C code that you link

0 commit comments

Comments
 (0)