[Up: Implementation Overview]
[Previous: IDL Compiler] [Next: C++ mapping]

Subsections


Compiler and Linker Wrappers

It can be quite complicated to compile and link MICO applications because you have to specify system dependent compiler flags, linker flags and libraries. This is why MICO provides you with four shells scripts:

mico-c++
 
should be used as the C++ compiler when compiling the C++ source files of a MICO-application.
mico-ld
 
should be used as the linker when linking together the .o files of a MICO-application.
mico-shc++
 
should be used as the C++ compiler when compiling the C++ source files of a MICO dynamically loadable module. mico-shc++ will not be available unless you specified the -enable-dynamic option during configuration.
mico-shld
 
should be used as the linker when linking together the .o files of a MICO dynamically loadable module. mico-shld will not be available unless you specified the -enable-dynamic option during configuration.

The scripts can be used just like the normal compiler/linker, except that for mico-shld you do not specify a file name suffix for the output file because mico-shld will append a system dependent shared object suffix (.so on most systems) to the specified output file name.

Examples

Let us consider building a simple MICO-aplication that consists of two files: account.idl and main.cc. Here is how to build account:

  idl account.idl
  mico-c++ -I. -c account.cc -o account.o
  mico-c++ -I. -c main.cc -o main.o
  mico-ld account.o main.o -o account -lmico2.3.6

As a second example let us consider building a dynamically loadable module and a client program that loads the module. We have three source files now: account.idl, client.cc, and module.cc:

  idl account.idl
  mico-shc++ -I. -c account.cc -o account.o
  mico-shc++ -I. -c module.cc -o module.o
  mico-shld -o module module.o account.o -lmico2.3.6

  mico-c++ -I. -c client.cc -o client.o
  mico-ld account.o client.o -o client -lmico2.3.6

Note that


[Previous: IDL Compiler] [Next: C++ mapping]
[Up: Implementation Overview]

Frank Pilhofer
2001-09-28