【问题标题】:Link external libraries portably?可移植地链接外部库?
【发布时间】:2010-07-24 01:32:06
【问题描述】:

我有一个在 VC++ 2008 中创建的 .dll 文件,需要广泛分发,但也需要外部资源(即 OpenSSL 库)才能运行。该 dll 可以在我自己的系统以及手动安装了适当外部库的任何其他系统上完美编译和运行,但我需要 .dll 本身包含所有必要的数据。

目前外部资源通过以下方式链接

#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#pragma comment(lib, "Ws2_32.lib")

这并没有完全削减它。有没有办法将所有这些都包含在 dll 中?

【问题讨论】:

    标签: c++ openssl dll


    【解决方案1】:

    在您的发行版中包含 OpenSSL DLL,或将您的 DLL 与 静态 OpenSSL 库链接。来自他们的INSTALL.W32

    ...
    You can also build a static version of the library using the Makefile ms\nt.mak
    ...

    【讨论】:

    • 谢谢,做了一些工作,但我设法正确打包了静态库。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-01
    相关资源
    最近更新 更多