blob: acd90029f343f2649b417953271823fdb679e78c [file] [log] [blame]
<body bgcolor="#ffffff">
<H1>SWIG Tcl Examples</H1>
The following examples illustrate the use of SWIG with Tcl.
<li><a href="simple/index.html">simple</a>. A minimal example showing how SWIG can
be used to wrap a C function and a global variable.
<li><a href="constants/index.html">constants</a>. This shows how preprocessor macros and
certain C declarations are turned into constants.
<li><a href="variables/index.html">variables</a>. How SWIG can be used to wrap C global variables.
<li><a href="value/index.html">value</a>. How to pass and return structures by value.
<li><a href="class/index.html">class</a>. How wrap a simple C++ class.
<li><a href="reference/index.html">reference</a>. C++ references.
<li><a href="pointer/index.html">pointer</a>. Simple pointer handling.
<li><a href="funcptr/index.html">funcptr</a>. Pointers to functions.
<h2>Compilation Issues</h2>
<li>To create a Tcl extension, SWIG is run with the following options:
% swig -tcl interface.i
Please see the <a href="../../Doc/Manual/Windows.html">Windows</a> page in the main manual for information on using the examples on Windows. <p>
<li>The compilation of examples is done using the file <tt>Example/Makefile</tt>. This
makefile performs a manual module compilation which is platform specific. Typically,
the steps look like this (Linux):
unix % swig -tcl interface.i
unix % gcc -fpic -c interface_wrap.c -I/usr/local/include
unix % gcc -shared interface_wrap.o $(OBJS) -o
unix % tclsh8.3
% load ./
% blah ...
The examples have been extensively tested on the following platforms:
Your mileage may vary. If you experience a problem, please let us know by
contacting us on the <a href="">mailing lists</a>.