创建包含所有依赖项的独立 DLL

发布于 2024-11-19 06:19:50 字数 499 浏览 5 评论 0原文

我正在 VS9 中开发一个 C++ 项目,该项目引用了许多头文件、.dll 和 .lib 文件。

我想将其输出为包含所有依赖项的独立 DLL,以便我可以使用 LoadLibrary() 来将其引入。

这可能吗?如果可以,我该如何在 VS9 中做到这一点?

我已经创建了 DLL,但是通过 dependent.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.

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖迟 2024-11-26 06:19:50

如果其他 DLL 恰好是 CRT,请使用 /MT 将消除依赖性。如果您正在处理其他一些 DLL,则可以将它们嵌入为资源,然后在运行时加载它们。我自己从未这样做过,但您可以通过阅读以下内容来完成此操作:

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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文