To create your own subsystem runtime library, follow these steps:
Note: If you do not use the ILIB utility, you must ensure that all objects that access your runtime DLL are statically linked to the appropriate object library.
icc /C /Gn+ /Ge+ /Rn myprog.c icc /C /Gn+ /Ge- /Rn mydll.c
When you link your objects, specify your own import library.
If
you are using or plan to use the API, specify
KERNEL32.LIB. For example:
ILINK myprog.obj mysdlli.lib KERNEL32.LIB ILINK mydll.obj mysdlli.lib KERNEL32.LIB /DEF mydll.exp
To compile and link in one step, use the commands:
icc /Gn+ /Ge+ /Rn myprog.c mysdlli.exp KERNEL32.LIB icc /Gn+ /Ge- /Rn mydll.c mysdlli.exp KERNEL32.LIB
If you are using or plan to use the API,
specify OS2386.LIB. For example:
ILINK myprog.obj mysdlli.lib OS2386.LIB ILINK mydll.obj mysdlli.lib OS2386.LIB /DEF
To compile and link in one step, use the commands:
icc /Gn+ /Ge+ /Rn myprog.c mysdlli.exp OS2386.LIB icc /Gn+ /Ge- /Rn mydll.c OS2386.LIB
For example:
ILINK /NOD mydll.obj CPPRNO36.LIB mysdlli.lib KERNEL32.LIB /DLL mydll.exp;
The /NOD option tells the linker to disregard the default libraries specified in the object files and use only the libraries given on the command line. If you are using icc to invoke the linker, the commands would be:
icc /B /NOD /Rn myprog.c CPPRNO36.LIB mysdlli.lib icc /Ge- /B /NOD /Rn mydll.c CPPRNO36.LIB mysdlli.lib
The linker then links the objects from the object library directly into your executable module or DLL.
![]()
Example of a Subsystem
_DLL_InitTerm Function (OS/2)