【问题标题】:Cygwin compiler header include error (OpenSSL)Cygwin 编译器标头包含错误 (OpenSSL)
【发布时间】:2013-10-15 13:57:46
【问题描述】:

我已经在 Windows 8 下安装了 Cygwin 来编译一个小的 C 项目。虽然 OpenSSL 包已包含在 Cygwin 的安装中,但在编译项目时(在 Cygwin 终端中使用命令 ma​​ke -f makefile)我得到一个错误:

make -s -C lib -f local.mk
CC auth.c
In file included from auth.h:9:0,
                 from auth.c:18:
session.h:11:24: fatal error: openssl/dh.h: No such file or directory
 #include <openssl/dh.h>
                        ^
compilation terminated.
local.mk:35: recipe for target 'auth.lo' failed
make[1]: *** [auth.lo] Error 1
makefile:79: recipe for target 'lib' failed
make: *** [lib] Error 2

查看Cygwin的文件夹,Openssl headers位于

/cygwin64/usr/i686-pc-cygwin/sys-root/usr/include/openssl

既不处理 /cygwin64/usr/include 中的 openssl 文件夹,也不添加指令

C_INCLUDE_PATH=/cygwin64/usr/i686-pc-cygwin/sys-root/usr/include/openssl

进入makefile已经解决了这个问题。它一直抛出相同的错误....我可以尝试什么?

【问题讨论】:

    标签: header openssl makefile cygwin


    【解决方案1】:

    有头文件吗?如果没有,OpenSSL 头文件位于名为 openssl-devel 的包中。

    【讨论】:

    • 是的,头文件在那里,但是编译器会忽略它们。除非安装在某处失败
    • 我安装了一个 mingw openssl 包或其他东西,当我安装 openssl-devel 时,一切正常。 (又名这个答案对我有用,谢谢)
    • openssl-devel 包已过时。选择此软件包进行安装将导致替换此软件包的 libssl-devel 软件包被安装。
    【解决方案2】:

    好的,我已经解决了问题:

    1. 清除 Cygwin 64 并从头开始使用 32 位版本
    2. 从 openssl.org 安装最新的 Openssl
    3. 已编译。没有更多问题了!

    【讨论】:

      猜你喜欢
      • 2015-03-23
      • 1970-01-01
      • 2017-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 2014-05-26
      • 1970-01-01
      相关资源
      最近更新 更多