在我的c程序中静态链接OpenSSL

时间:2014-09-09 15:50:30

标签: c++ c oracle gcc makefile

我正在尝试在Oracle 12 HTTP Server中使用mod_auth_cas。然而,甲骨文在其无限的wizdumb中已经删除了mod_ssl并且随之而来的是它自己的ossl。所以现在我的mod_auth_cas不起作用,因为它与openSSL链接。 (我得到一个“未定义的符号SSL_connect”错误)

查看代码(https://github.com/Jasig/mod_auth_cas/tree/master/src),我看到了:

#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

我知道我可以通过gcc编译器静态链接它,但是它使用Makefile而我绝不是(我是一个Java人)我有能力在makefile中执行此操作。

所以我的问题是:

  1. 我可以强制编译器静态地将openssl与代码本身联系起来,所以我不必混淆makefile(就像有一个#includestatic指令)
  2. OR

    1. 我需要makefile吗?我可以创建一个单行gcc来编译我需要的东西(它只有2个.c文件和2个.h文件)
    2. OR

      1. 我可以针对oracle使用的mod_ossl进行编译吗?我怎么会这样做,因为我不知道我在这做什么。 :)
      2. 感谢您的任何提示!

1 个答案:

答案 0 :(得分:1)

  1. 不,你需要修改makefile。
  2. 是的,您可以使用一个命令完成所有操作。
  3. 可能不是。
相关问题