d to read
the man pages). 
</p>

<H3><a name="Tcl_nn7">37.1.5 Compilation of C++ extensions</a></H3>


<p>
Compilation of C++ extensions has traditionally been a tricky problem.
Since the Tcl interpreter is written in C, you need to take steps to
make sure C++ is properly initialized and that modules are compiled
correctly.
</p>

<p>
On most machines, C++ extension modules should be linked using the C++
compiler.  For example:
</p>

<div class="code"><pre>
% swig -c++ -tcl example.i
% g++ -fPIC -c example.c