Using the examples


EWG comes with the following examples

For an up-to-date list of EWG based wrapper libraries please visit the EWG Homepage. Note that all examples compile on all platforms with all compilers.

It is worth mentioning that the GTK wrapper is already pretty much advanced (although by for not complete yet). By using an inheritance trick GTK-EWG supports agents (which is a powerful concept especially for GUIs), but has fall-back support for command classes on Visual Eiffel (which doesn't support agents yet).


The following is a list of requirements that need to be fullfilled in order to build library wrappers with EWG and compile applications using those library wrappers. Please note that these are not necessarily the same as the requirements needed to compile EWG (the tool) itself.

Please note that the code generated by EWG does not require GOBO. The examples supplied with EWG need the GOBO build tools though.

Support for Visual Eiffel on Windows is currently not fully supported, because I only have the free version of Visual Eiffel. This version refuses to compile the bigger examples like OpenGL and GTK 2.x, thus I cannot test them.

The examples provided with EWG have been tested using the following combinations:

Other combinations might or might not work. If you test another combination I would be happy to hear from your results.

Building and Running the examples

This step requires that you already have compiled the ewg tool. If you have downloaded a release package for you platform, you are lucky, since these packages already come with the ewg tool pre-compiled.

You can find examples on how to use EWG to create wrappers for C libraries in the directory ${EWG}/example. These examples are fully functional, in that they include the necessary build automation to build the examples using all platform/eiffel-compiler/c-compiler combinations.

Most examples wrap a 3rd party C library. If you want to build such an example please read the Readme.txt file in the examples directory. It is usually necessary for you to install certain development versions of the libraries to wrap. The Readme.txt file gives details on what is necessary.

To generate the Eiffel wrapper for a given example go into the library subdirectory of the examples directory. The examples usually have two subdirectories. library contains the files necessary to build the wrapper and hello_world contains the source code for an actual Eiffel application that uses the wrapper. For example to generate the wrappers for the simple-example do:

	  cd ${EWG}/example/simple/library
	  geant install
	  geant c_build_library

This will use the ewg tool to generate Eiffel and C files that make the c library accessible from within Eiffel. It may sound weird that C files are generated too, but it is unfortunately necessary. The generated C files will be compiled and put into a static link library.

To compile and run an example application go into the example applications directory. For example to build the hello_world application of the simple example do:

	  cd ${EWG}/example/simple/example/hello_world
	  geant install
	  geant compile

Copyright 2004-2005, Andreas Leitner
Last Updated: 8 March 2005