You can't statically link a DLL, only a LIB. DLLs are self contained and have static members and DllMain load/unload dependencies that means they cannot be split into containing functions and linked into a different executable. You should create an installer that deploys all the appropriate dlls, as needed.
How do I link to a DLL?
To explicitly link to a DLL, an application must:
- Call LoadLibraryEx or a similar function to load the DLL and obtain a module handle.
- Call GetProcAddress to obtain a function pointer to each exported function that the application calls. ...
- Call FreeLibrary when done with the DLL.
Can a exe link to DLL and static library at the same time?
as you can see, the exe and dll shares some of the static libraries ( core. lib and utils. lib ) and exe in-turn uses the DLL ( through "load time dynamic linking" using import library).