After you fill in the method stub procedures, the implementation template file can be compiled and linked with a client program as follows. (In these examples, the environment variable SOMBASE represents the directory in which SOM has been installed.)
Note: If you are building an application that uses a combination of C and C++ compiled object modules, then the C++ linker must be used to link them.
For AIX: When the client program (main.c) and the implementation file (hello.c) are written in C:
> xlc -I. -I$SOMBASE/include -o hello main.c hello.c -L$SOMBASE/lib -lsomtk
When the client program and the implementation file are written in C++:
> xlC -I. -I$SOMBASE/include -o hello main.C hello.C -L$SOMBASE/lib -lsomtk
For OS/2: When the client program (main.c) and the implementation file (hello.c) are in C:
> set LIB=%SOMBASE%\lib;%LIB% > icc -I. -I%SOMBASE%\include -Fe hello main.c hello.c somtk.lib
When the client program and the implementation file are written in C++:
> set LIB=%SOMBASE%\lib;%LIB% > icc -I. -I%SOMBASE%\include -Fe hello main.cpp hello.cpp somtk.lib
If the class definition (in the .idl file) changes, run the SOM Compiler again. This will generate new header files, and it will update the implementation file to include any:
After rerunning the SOM Compiler, add to the implementation file the code for any newly added method procedures, and recompile the implementation file with the client program.