代码之家  ›  专栏  ›  技术社区  ›  Srikanth

libssl版本0.9.8e是否与0.9.7a兼容?

  •  1
  • Srikanth  · 技术社区  · 15 年前

    我在C++项目中使用了一个第三方静态库,它依赖于LIbSSL版本0.97A。由于各种原因,我的项目使用的LBSSL版本是0.98E。

    一切正常,直到第三方最近改变了他们的静态库。当我的应用程序包含这个新版本的静态库时,我无法成功地编译它。旧版本编译得很好。

    我不太熟悉这些库依赖项及其向后兼容性。我们被告知必须使用第三方建议的版本。我只是想知道这是否真的是原因。我想它应该是向后兼容的,不是吗?

    对于这个问题的任何解决方向都非常感谢。

    下面是我得到的编译错误:

    cc1plus: note: obsolete option -I- used, please use -iquote instead
    
    In file included from /usr/include/openssl/e_os2.h:56,
                     from /usr/include/openssl/ssl.h:173,
                     from MyClass.cpp:28:
    
    /usr/include/openssl/opensslconf.h:13:30: error: opensslconf-i386.h: No such file or directory
    /usr/include/openssl/bn.h:288: error: expected ';' before '*' token
    /usr/include/openssl/bn.h:304: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:407: error: 'BN_ULONG' was not declared in this scope
    /usr/include/openssl/bn.h:450: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:451: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:452: error: 'BN_ULONG' has not been declared
    /usr/include/openssl/bn.h:453: error: 'BN_ULONG' has not been declared
    /usr/include/openssl/bn.h:454: error: 'BN_ULONG' has not been declared
    /usr/include/openssl/bn.h:455: error: 'BN_ULONG' has not been declared
    /usr/include/openssl/bn.h:456: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:471: error: 'BN_ULONG' has not been declared
    /usr/include/openssl/bn.h:764: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:765: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:766: error: variable or field 'bn_sqr_words' declared void
    /usr/include/openssl/bn.h:766: error: 'BN_ULONG' was not declared in this scope
    /usr/include/openssl/bn.h:766: error: 'rp' was not declared in this scope
    /usr/include/openssl/bn.h:766: error: expected primary-expression before 'const'
    /usr/include/openssl/bn.h:766: error: expected primary-expression before 'int'
    /usr/include/openssl/bn.h:767: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:768: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/bn.h:769: error: 'BN_ULONG' does not name a type
    /usr/include/openssl/ssl3.h:303: error: 'PQ_64BIT' does not name a type
    /usr/include/openssl/pqueue.h:73: error: 'PQ_64BIT' does not name a type
    /usr/include/openssl/pqueue.h:80: error: 'PQ_64BIT' was not declared in this scope
    /usr/include/openssl/pqueue.h:80: error: expected primary-expression before 'void'
    /usr/include/openssl/pqueue.h:89: error: 'PQ_64BIT' has not been declared
    /usr/include/openssl/dtls1.h:92: error: 'PQ_64BIT' does not name a type
    /usr/include/openssl/dtls1.h:94: error: 'PQ_64BIT' does not name a type
    

    错误消息表示没有opensslconf-i386.h这样的文件,但它确实存在。

    知道怎么回事吗?

    谢谢你的时间!

    1 回复  |  直到 15 年前
        1
  •  3
  •   Jonathan Leffler    15 年前

    C预处理器找不到opensslconf-i386.h文件,所以您需要找出失败的原因。编译器警告您使用一个过时的选项(它建议一个修复方法)——执行它。

    好的-你说文件存在:它在哪里,它的权限是什么?opensslconf.h如何包含它?这一行与包含的任何其他OpenSSL头有何不同?除了不推荐使用的“-i-”之外,您使用的“-i”选项是什么?

    在这个阶段,我会说你要么安装错误,要么有一个奇怪的球命令行。

    题目是…与问题主体不明显相关。

    • 在操作层面上,是的,这两种方法在大多数情况下是相互作用的。
    • 在编译级别,是的,这两者基本上是兼容的(在0.9.7a中工作的应该与0.9.8e一起工作)。
    • 在内部和配置级别,会有一些小的差异;例如,可能会有新版本支持的额外密码或模式。