可移植地链接外部库?
我有一个在 VC++ 2008 中创建的 .dll 文件,需要广泛分发,但也需要外部资源(即 OpenSSL 库)才能运行。该 dll 在我自己的系统以及手动安装了适当外部库的任何其他系统上都能完美编译和运行,但我需要 .dll 本身包含所有必要的数据。
目前外部资源是通过 链接的
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#pragma comment(lib, "Ws2_32.lib")
,但这还不够。有没有办法将所有这些都包含在 dll 中?
I've got a .dll file created in VC++ 2008 that needs to be widely distributed, but also requires external resources (namely OpenSSL libraries) to operate. The dll compiles and runs perfectly well on my own system, as well as any other system with the appropriate external libraries manually installed on them, but I need for the .dll itself to contain all necessary data itself.
At present the external resources are linked via
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#pragma comment(lib, "Ws2_32.lib")
and that's not quite cutting it. Is there a way to have all of this included in the dll?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的发行版中包含 OpenSSL DLL,或将您的 DLL 与静态 OpenSSL 库链接。来自他们的
INSTALL.W32
:Include OpenSSL DLLs with your distribution, or link your DLL with static OpenSSL libraries. From their
INSTALL.W32
: