1

我在我的 C++ 项目中使用第三方静态库,它依赖于 libssl 版本 0.9.7a。由于种种原因,我的项目使用的libssl版本是0.9.8e。

一切正常,直到第三方最近对其静态库进行了更改。当我的应用程序包含这个新版本的静态库时,我无法成功编译它。旧版本编译良好。

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

非常感谢任何解决此问题的方向。

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

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 这样的文件,但它确实存在。

知道出了什么问题吗?

谢谢你的时间!

4

1 回答 1

3

C 预处理器没有找到 opensslconf-i386.h 文件 - 所以您需要找出失败的原因。您从编译器收到关于使用过时选项的警告(并且它建议修复) - 执行此操作。

好的 - 你说文件存在:它在哪里,它的权限是什么?opensslconf.h 如何包含它?该行与包含的任何其他 OpenSSL 标头有何不同。除了已弃用的“-I-”之外,您还使用了哪些“-I”选项?

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

问题标题是......与问题主体没有明显关系。

  • 在操作层面上,是的,这两者在大多数情况下都是互通的。
  • 在编译层面,是的,两者基本上是兼容的(在 0.9.7a 中工作的应该在 0.9.8e 中工作)。
  • 在内部和配置层面,会有小的差异;例如,较新的版本可能支持额外的密码或模式。
于 2009-10-27T14:20:35.307 回答