3 <title>SWIG:Examples:tcl</title>
6 <body bgcolor="#ffffff">
7 <H1>SWIG Tcl Examples</H1>
10 The following examples illustrate the use of SWIG with Tcl.
13 <li><a href="simple/index.html">simple</a>. A minimal example showing how SWIG can
14 be used to wrap a C function and a global variable.
15 <li><a href="constants/index.html">constants</a>. This shows how preprocessor macros and
16 certain C declarations are turned into constants.
17 <li><a href="variables/index.html">variables</a>. How SWIG can be used to wrap C global variables.
18 <li><a href="value/index.html">value</a>. How to pass and return structures by value.
19 <li><a href="class/index.html">class</a>. How wrap a simple C++ class.
20 <li><a href="reference/index.html">reference</a>. C++ references.
21 <li><a href="pointer/index.html">pointer</a>. Simple pointer handling.
22 <li><a href="funcptr/index.html">funcptr</a>. Pointers to functions.
25 <h2>Compilation Issues</h2>
28 <li>To create a Tcl extension, SWIG is run with the following options:
32 % swig -tcl interface.i
37 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>
40 <li>The compilation of examples is done using the file <tt>Example/Makefile</tt>. This
41 makefile performs a manual module compilation which is platform specific. Typically,
42 the steps look like this (Linux):
46 unix % swig -tcl interface.i
47 unix % gcc -fpic -c interface_wrap.c -I/usr/local/include
48 unix % gcc -shared interface_wrap.o $(OBJS) -o interface.so
56 <h2>Compatibility</h2>
58 The examples have been extensively tested on the following platforms:
65 Your mileage may vary. If you experience a problem, please let us know by
66 contacting us on the <a href="http://www.swig.org/mail.html">mailing lists</a>.