c - 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 吗?
感谢您的任何帮助。
解决方案
推荐阅读
- unicode - 是否可以在 Keil uVision 5 中使用十六进制值超过 0xFF 的 unicode?
- python - SnowBoy 启动指令检测问题
- java - 如何从相同的 ControllerAdvice 方法返回对象或视图?
- c# - 从 ASP.NET 中的 gridview 下载文件时如何保存文件路径
- sql - 数据库查询以生成基于时间的图表
- nativescript - Nativescript 应用程序因“遇到未定义的提供程序!”而崩溃 在 IOS 上加载模块但在 Android 上工作之前
- mysql - MYSQL,包括空结果
- shell - 检查文件是否存在于 3 个不同的目录中并将它们移动到另一个
- curl - 在 VS2017、x64 中使用 curl
- sql - MIN DATE 有两个表和同一项目的多个实例