| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="ext.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="ext.html" title='Extending and Embedding the Python Interpreter' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='last' href='about.html' title='About this document...' /> |
| 10 | <link rel='help' href='about.html' title='About this document...' /> |
| 11 | <link rel="next" href="embedding.html" /> |
| 12 | <link rel="prev" href="building.html" /> |
| 13 | <link rel="parent" href="ext.html" /> |
| 14 | <link rel="next" href="win-cookbook.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>4. Building C and C++ Extensions on Windows</title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="3.1 Distributing your extension" |
| 24 | href="distributing.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="Extending and Embedding the" |
| 27 | href="ext.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="4.1 A Cookbook Approach" |
| 30 | href="win-cookbook.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> |
| 33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 34 | href="contents.html"><img src='../icons/contents.png' |
| 35 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 36 | <td class='online-navigation'><img src='../icons/blank.png' |
| 37 | border='0' height='32' alt='' width='32' /></td> |
| 38 | <td class='online-navigation'><img src='../icons/blank.png' |
| 39 | border='0' height='32' alt='' width='32' /></td> |
| 40 | </tr></table> |
| 41 | <div class='online-navigation'> |
| 42 | <b class="navlabel">Previous:</b> |
| 43 | <a class="sectref" rel="prev" href="distributing.html">3.1 Distributing your extension</A> |
| 44 | <b class="navlabel">Up:</b> |
| 45 | <a class="sectref" rel="parent" href="ext.html">Extending and Embedding the</A> |
| 46 | <b class="navlabel">Next:</b> |
| 47 | <a class="sectref" rel="next" href="win-cookbook.html">4.1 A Cookbook Approach</A> |
| 48 | </div> |
| 49 | <hr /></div> |
| 50 | </DIV> |
| 51 | <!--End of Navigation Panel--> |
| 52 | |
| 53 | <H1><A NAME="SECTION006000000000000000000"></A><A NAME="building-on-windows"></A> |
| 54 | <BR> |
| 55 | 4. Building C and C++ Extensions on Windows |
| 56 | </H1> |
| 57 | |
| 58 | <P> |
| 59 | This chapter briefly explains how to create a Windows extension module |
| 60 | for Python using Microsoft Visual C++, and follows with more |
| 61 | detailed background information on how it works. The explanatory |
| 62 | material is useful for both the Windows programmer learning to build |
| 63 | Python extensions and the <span class="Unix">Unix</span> programmer interested in producing |
| 64 | software which can be successfully built on both <span class="Unix">Unix</span> and Windows. |
| 65 | |
| 66 | <P> |
| 67 | Module authors are encouraged to use the distutils approach for |
| 68 | building extension modules, instead of the one described in this |
| 69 | section. You will still need the C compiler that was used to build |
| 70 | Python; typically Microsoft Visual C++. |
| 71 | |
| 72 | <P> |
| 73 | <div class="note"><b class="label">Note:</b> |
| 74 | This chapter mentions a number of filenames that include an encoded |
| 75 | Python version number. These filenames are represented with the |
| 76 | version number shown as "<tt class="samp">XY</tt>"; in practive, "<tt class="character">X</tt>" will |
| 77 | be the major version number and "<tt class="character">Y</tt>" will be the minor |
| 78 | version number of the Python release you're working with. For |
| 79 | example, if you are using Python 2.2.1, "<tt class="samp">XY</tt>" will actually be |
| 80 | "<tt class="samp">22</tt>". |
| 81 | </div> |
| 82 | |
| 83 | <P> |
| 84 | |
| 85 | <p><br /></p><hr class='online-navigation' /> |
| 86 | <div class='online-navigation'> |
| 87 | <!--Table of Child-Links--> |
| 88 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 89 | |
| 90 | <UL CLASS="ChildLinks"> |
| 91 | <LI><A href="win-cookbook.html">4.1 A Cookbook Approach</a> |
| 92 | <LI><A href="dynamic-linking.html">4.2 Differences Between <span class="Unix">Unix</span> and Windows</a> |
| 93 | <LI><A href="win-dlls.html">4.3 Using DLLs in Practice</a> |
| 94 | </ul> |
| 95 | <!--End of Table of Child-Links--> |
| 96 | </div> |
| 97 | |
| 98 | <DIV CLASS="navigation"> |
| 99 | <div class='online-navigation'> |
| 100 | <p></p><hr /> |
| 101 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 102 | <tr> |
| 103 | <td class='online-navigation'><a rel="prev" title="3.1 Distributing your extension" |
| 104 | href="distributing.html"><img src='../icons/previous.png' |
| 105 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 106 | <td class='online-navigation'><a rel="parent" title="Extending and Embedding the" |
| 107 | href="ext.html"><img src='../icons/up.png' |
| 108 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 109 | <td class='online-navigation'><a rel="next" title="4.1 A Cookbook Approach" |
| 110 | href="win-cookbook.html"><img src='../icons/next.png' |
| 111 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 112 | <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> |
| 113 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 114 | href="contents.html"><img src='../icons/contents.png' |
| 115 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 116 | <td class='online-navigation'><img src='../icons/blank.png' |
| 117 | border='0' height='32' alt='' width='32' /></td> |
| 118 | <td class='online-navigation'><img src='../icons/blank.png' |
| 119 | border='0' height='32' alt='' width='32' /></td> |
| 120 | </tr></table> |
| 121 | <div class='online-navigation'> |
| 122 | <b class="navlabel">Previous:</b> |
| 123 | <a class="sectref" rel="prev" href="distributing.html">3.1 Distributing your extension</A> |
| 124 | <b class="navlabel">Up:</b> |
| 125 | <a class="sectref" rel="parent" href="ext.html">Extending and Embedding the</A> |
| 126 | <b class="navlabel">Next:</b> |
| 127 | <a class="sectref" rel="next" href="win-cookbook.html">4.1 A Cookbook Approach</A> |
| 128 | </div> |
| 129 | </div> |
| 130 | <hr /> |
| 131 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 132 | </DIV> |
| 133 | <!--End of Navigation Panel--> |
| 134 | <ADDRESS> |
| 135 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 136 | </ADDRESS> |
| 137 | </BODY> |
| 138 | </HTML> |