我正在 VS9 中开发一个 C++ 项目,该项目引用了许多头文件、.dll 和 .lib 文件。
我想将其作为包含所有依赖项的独立 DLL 输出,这样我就可以使用 LoadLibrary() 将其拉入。
这可能吗?如果可以,我该如何在 VS9 中实现?
我已经创建了 DLL,但是通过 depends.exe 运行它会出现错误:
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.
谢谢
最佳答案
如果其他 DLL 恰好是 CRT,则使用 /MT 进行编译会消除依赖。如果您正在处理其他一些 DLL,您可以将它们作为资源嵌入,然后在运行时加载它们。我自己从未这样做过,但您可以通过阅读按照自己的方式工作:
关于c++ - 创建包含所有依赖项的独立 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6617350/