3
<title>SWIG:Examples:tcl</title>
6
<body bgcolor="#ffffff">
7
<H1>SWIG Tcl Examples</H1>
9
<tt>$Header: /cvs/projects/SWIG/Examples/tcl/index.html,v 1.7.4.2 2001/12/08 23:33:37 cheetah Exp $</tt><br>
12
The following examples illustrate the use of SWIG with Tcl.
15
<li><a href="simple/index.html">simple</a>. A minimal example showing how SWIG can
16
be used to wrap a C function and a global variable.
17
<li><a href="constants/index.html">constants</a>. This shows how preprocessor macros and
18
certain C declarations are turned into constants.
19
<li><a href="variables/index.html">variables</a>. How SWIG can be used to wrap C global variables.
20
<li><a href="value/index.html">value</a>. How to pass and return structures by value.
21
<li><a href="class/index.html">class</a>. How wrap a simple C++ class.
22
<li><a href="reference/index.html">reference</a>. C++ references.
23
<li><a href="pointer/index.html">pointer</a>. Simple pointer handling.
24
<li><a href="funcptr/index.html">funcptr</a>. Pointers to functions.
27
<h2>Compilation Issues</h2>
30
<li>To create a Tcl extension, SWIG is run with the following options:
34
% swig -tcl interface.i
39
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>
42
<li>The compilation of examples is done using the file <tt>Example/Makefile</tt>. This
43
makefile performs a manual module compilation which is platform specific. Typically,
44
the steps look like this (Linux):
48
unix % swig -tcl interface.i
49
unix % gcc -fpic -c interface_wrap.c -I/usr/local/include
50
unix % gcc -shared interface_wrap.o $(OBJS) -o interface.so
58
<h2>Compatibility</h2>
60
The examples have been extensively tested on the following platforms:
67
Your mileage may vary. If you experience a problem, please let us know by
68
sending a message to <a href="mailto:swig-dev@cs.uchicago.edu">swig-dev@cs.uchicago.edu</a>.