run SWIG using the <tt>-tcl</tt> or <tt>-tcl8</tt> option :
</p>

<div class="code"><pre>
$ swig -tcl example.i
</pre></div>

<p>
If building a C++ extension, add the <tt>-c++</tt> option:
</p>

<div class="code"><pre>
$ swig -c++ -tcl example.i
</pre></div>

<p>
This creates a file <tt>example_wrap.c</tt> or
<tt>example_wrap.cxx</tt> that contains all of the code needed to
build a Tcl extension module.  To finish building the module, you 
need to compile this file and link it with the rest of your program.