<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <link rel="STYLESHEET" href="ext.css" type='text/css' /> <link rel="SHORTCUT ICON" href="../icons/pyfav.gif" /> <link rel='start' href='../index.html' title='Python Documentation Index' /> <link rel="first" href="ext.html" title='Extending and Embedding the Python Interpreter' /> <link rel='contents' href='contents.html' title="Contents" /> <link rel='last' href='about.html' title='About this document...' /> <link rel='help' href='about.html' title='About this document...' /> <LINK rel="next" href="link-reqs.html"> <LINK rel="prev" href="extending-with-embedding.html"> <LINK rel="parent" href="embedding.html"> <LINK rel="next" href="link-reqs.html"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name='aesop' content='information' /> <META name="description" content="Embedding Python in C++ "> <META name="keywords" content="ext"> <META name="resource-type" content="document"> <META name="distribution" content="global"> <title>5.5 Embedding Python in C++ </title> </head> <body> <DIV CLASS="navigation"> <div id='top-navigation-panel'> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td class='online-navigation'><a rel="prev" title="5.4 Extending Embedded Python" href="extending-with-embedding.html"><img src='../icons/previous.png' border='0' height='32' alt='Previous Page' width='32' /></A></td> <td class='online-navigation'><a rel="parent" title="5. Embedding Python in" href="embedding.html"><img src='../icons/up.png' border='0' height='32' alt='Up One Level' width='32' /></A></td> <td class='online-navigation'><a rel="next" title="5.6 Linking Requirements" href="link-reqs.html"><img src='../icons/next.png' border='0' height='32' alt='Next Page' width='32' /></A></td> <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> <td class='online-navigation'><a rel="contents" title="Table of Contents" href="contents.html"><img src='../icons/contents.png' border='0' height='32' alt='Contents' width='32' /></A></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> </tr></table> <div class='online-navigation'> <b class="navlabel">Previous:</b> <a class="sectref" rel="prev" href="extending-with-embedding.html">5.4 Extending Embedded Python</A> <b class="navlabel">Up:</b> <a class="sectref" rel="parent" href="embedding.html">5. Embedding Python in</A> <b class="navlabel">Next:</b> <a class="sectref" rel="next" href="link-reqs.html">5.6 Linking Requirements</A> </div> <hr /></div> </DIV> <!--End of Navigation Panel--> <H1><A NAME="SECTION007500000000000000000"><!--x--></A><A NAME="embeddingInCplusplus"><!--z--></A> <BR> 5.5 Embedding Python in C++ </H1> <P> It is also possible to embed Python in a C++ program; precisely how this is done will depend on the details of the C++ system used; in general you will need to write the main program in C++, and use the C++ compiler to compile and link your program. There is no need to recompile Python itself using C++. <P> <DIV CLASS="navigation"> <div class='online-navigation'><hr /> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td class='online-navigation'><a rel="prev" title="5.4 Extending Embedded Python" rel="prev" title="5.4 Extending Embedded Python" href="extending-with-embedding.html"><img src='../icons/previous.png' border='0' height='32' alt='Previous Page' width='32' /></A></td> <td class='online-navigation'><a rel="parent" title="5. Embedding Python in" rel="parent" title="5. Embedding Python in" href="embedding.html"><img src='../icons/up.png' border='0' height='32' alt='Up One Level' width='32' /></A></td> <td class='online-navigation'><a rel="next" title="5.6 Linking Requirements" rel="next" title="5.6 Linking Requirements" href="link-reqs.html"><img src='../icons/next.png' border='0' height='32' alt='Next Page' width='32' /></A></td> <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> <td class='online-navigation'><a rel="contents" title="Table of Contents" rel="contents" title="Table of Contents" href="contents.html"><img src='../icons/contents.png' border='0' height='32' alt='Contents' width='32' /></A></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> </tr></table> <div class='online-navigation'> <b class="navlabel">Previous:</b> <a class="sectref" rel="prev" href="extending-with-embedding.html">5.4 Extending Embedded Python</A> <b class="navlabel">Up:</b> <a class="sectref" rel="parent" href="embedding.html">5. Embedding Python in</A> <b class="navlabel">Next:</b> <a class="sectref" rel="next" href="link-reqs.html">5.6 Linking Requirements</A> </div> </div> <hr /> <span class="release-info">Release 2.3.4, documentation updated on May 20, 2004.</span> </DIV> <!--End of Navigation Panel--> <ADDRESS> See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. </ADDRESS> </BODY> </HTML>