开发者

Creating a standalone DLL that contains all dependencies

开发者 https://www.devze.com 2023-03-18 15:50 出处:网络
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'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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号