Creating a standalone DLL that contains all dependencies
I'm working on a C++ project in VS9 that references a number of header files, .dll and .lib files.
I want to output this as a standalone DLL containing all the dependencies so that 开发者_运维知识库I can just use LoadLibrary() to pull this in.
Is this possible, and if so, how do I do it in VS9?
I've created the DLL, but running it through depends.exe gives me errors:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Thanks
If the other DLLs happen to be the CRT, compiling with /MT would eliminate the dependency. If you're dealing with some other DLLs, you can embed them as resources, and then load them at runtime. I've never done this myself, but you can work your way by reading:
- Embedding DLL and binary files in the Win32 Executable
- Loading DLL from a location in memory
精彩评论