import source from 1.3.40
[external/swig.git] / Examples / tcl / index.html
1 <html>
2 <head>
3 <title>SWIG:Examples:tcl</title>
4 </head>
5
6 <body bgcolor="#ffffff">
7 <H1>SWIG Tcl Examples</H1>
8
9 <p>
10 The following examples illustrate the use of SWIG with Tcl.
11
12 <ul>
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.
23 </ul>
24
25 <h2>Compilation Issues</h2>
26
27 <ul>
28 <li>To create a Tcl extension, SWIG is run with the following options:
29
30 <blockquote>
31 <pre>
32 % swig -tcl interface.i
33 </pre>
34 </blockquote>
35
36 <li>
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>
38 </li>
39
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):
43
44 <blockquote>
45 <pre>
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
49 unix % tclsh8.3
50 % load ./interface.so
51 % blah ...
52 </pre>
53 </blockquote>
54 </ul>
55
56 <h2>Compatibility</h2>
57
58 The examples have been extensively tested on the following platforms:
59
60 <ul>
61 <li>Linux
62 <li>Solaris
63 </ul>
64
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>.
67 </body>
68 </html>
69
70