【问题标题】:Creating a standalone DLL that contains all dependencies创建包含所有依赖项的独立 DLL
【发布时间】:2011-07-07 21:27:04
【问题描述】:

我正在 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.

谢谢

【问题讨论】:

  • 你真正的问题是DependencyWalker,它跟不上时代。

标签: c++ visual-studio visual-c++-2008


【解决方案1】:

如果其他 DLL 恰好是 CRT,使用 /MT 编译将消除依赖关系。如果您正在处理其他一些 DLL,您可以将它们作为资源嵌入,然后在运行时加载它们。我自己从来没有这样做过,但是您可以通过阅读来按照自己的方式工作:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-22
    • 1970-01-01
    • 1970-01-01
    • 2012-04-01
    • 1970-01-01
    • 2014-01-08
    • 2019-11-02
    • 2011-05-07
    相关资源
    最近更新 更多