Compile and Link Your DLL in Separate Steps

To compile and link your DLL in separate steps:

Note: The compiler includes information in the object files on the C libraries you indicated by the compiler options that control code generation.These libraries are automatically used at link time. You do not need to specify C runtime libraries on the linker command line unless you want to override the ones you chose at compile time.

Example:
For example, the following commands compile the source files mydlla.c and mydllb.c and link the resulting object files with the single-thread, statically linked C libraries using the definition file mydll.def, to create the DLL finaldll.dll.

   icc  /C+ /Ge- mydlla.c mydllb.c

   ILIB /geni:finaldll.lib mydlla.obj mydllb.obj

ILINK mydlla.obj mydllb.obj mydll.exp /OUT:finaldll.dll
ILINK mydlla.obj mydllb.obj /OUT:finaldll.dll

If your DLL contains C++ code that uses templates, there are additional considerations. The preferred method is to use the icc command to compile and to invoke the linker for you.



Create a DLL - An Overview