You can compile and link your source files in one step or in separate steps. The preferred method is to compile and link in one step.
When you use icc to compile and link your DLL:
The method of linking used for the runtime libraries is independent of the module type you create; you can statically link the runtime functions in a dynamic link library.
All objects in a link must be compiled with the same settings of /Gm and /Gd.
By default, the name of the first source file (without the file name extension) is used as the name of the DLL. For example, to compile and link the files mydlla.c and mydllb.c, using the mydll.def module definition file, use the command:
icc /Ge- mydlla.c mydllb.c mydll.def
The resulting DLL will be called mydlla.dll.
Alternatively, you can specifically name the output DLL, for example:
icc /Ge- mydlla.c mydllb.c mydll.def /Femyname.dll
If your DLL contains C++ code that uses templates, there are additional considerations.
![]()
Create a DLL - An Overview
Compile and Link Your DLL in Separate
Steps