首页 > 解决方案 > Debian linux mingw 编译 Windows dll 包括 openssl 库

问题描述

我在 Debian linux 构建环境中,无法更改。我们使用 mingw 构建我们的应用程序,并希望在我们的一个应用程序中使用 openssl 工具套件。linux 版本包含 openssl/md5.h 并使用 -lcrypto 标志编译 gcc 并且效果很好。

我需要做什么来使用 mingw 构建 Windows dll 并包含 openssl? 我的构建命令看起来像这样

x86_64-w64-mingw32-gcc -shared -s FILE.c FILE.def -lcrypto -lws2_32 -o OUT.dll

这会产生错误致命错误 openssl/md5.h no such file or directory。

我试图添加 -I /path/to/openssl/includes 然后得到 ld 错误找不到 -lcrypto。我有 libssl-dev 库。

我有 openssl 的源代码,并尝试使用 mingw 编译它,正如其他一些文章所建议的那样。使用 MinGW 在 Windows 上使用 OpenSSL “找不到 -lcrypto -lssl” 但是构建总是失败,多个文件缺少包含位/libc-header-start.h。我的想法是,如果我可以在 linux 系统上获取 windows dll,也许这就是 mingw 所需要的。

在编译 HTK 时,我尝试按照这篇文章“致命错误:bits/libc-header-start.h:没有这样的文件或目录”中的建议安装 gcc-multilib, 但这会导致一篮子缺少依赖项。

甚至可以从 Debian 开发环境构建一个包含 openssl 依赖项的 Windows dll 吗?

感谢您的任何帮助。

标签: clinuxopensslmingwcross-compiling

解决方案


推荐阅读