Write the source files that are to access your DLL as if the functions and/or variables are to be statically linked at compile time. Then when you link the program, you must inform the linker that some function and/or variable references are to a DLL and will be resolved at run time. There are two ways to communicate this information to the linker:
If your DLL contains any C++ templates, you must always access the DLL by means of an import library to ensure that the names you use when you instantiate the template are resolved correctly.
If you invoke the linker directly, give the name of the import library where you normally specify library names. For example:
ILINK /NOI mymain.obj finaldll.lib;
If you invoke the linker through the icc command, you must put the name of the import library in the compiler invocation string. For example:
icc mymain.c finaldll.lib
Note: The import libraries for the IBM C and C++ Compilers runtime DLLs have been supplied with the compiler.
All DLLs must be in a directory listed in the LIBPATH environment variable or in BEGINLIBPATH or ENDLIBPATH, which prepend and append their contents to LIBPATH.