import source from 1.3.40
[external/swig.git] / Examples / ruby / import / README
1 This example tests the %import directive and working with multiple modules.
2
3 Use 'ruby runme.rb' to run a test.
4
5 Overview:
6 ---------
7
8 The example defines 4 different extension modules--each wrapping
9 a separate C++ class.
10
11      base.i     -  Base class
12      foo.i      -  Foo class derived from Base
13      bar.i      -  Bar class derived from Base
14      spam.i     -  Spam class derived from Bar
15
16 Each module uses %import to refer to another module.  For
17 example, the 'foo.i' module uses '%import base.i' to get
18 definitions for its base class.
19
20 If everything is okay, all of the modules will load properly and
21 type checking will work correctly. Caveat: Some compilers, for example
22 gcc-3.2.x, generate broken vtables with the inline methods in this test.
23 This is not a SWIG problem and can usually be solved with non-inlined
24 destructors compiled into separate shared objects/DLLs.
25
26 Unix:
27 -----
28 - Run make
29 - Run the test as described above
30
31 Windows:
32 --------
33 - Use the Visual C++ 6 workspace file (example.dsw). Build the runtime
34   project DLL first followed by the other 4 DLLs as they all have a
35   dependency on the runtime DLL. The Batch build option in the Build menu
36   is usually the easiest way to do this. Only use the Release builds not
37   the Debug builds.
38 - Run the test as described above
39