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

知道出了什么问题吗?

谢谢你的时间!

有帮助吗?

解决方案

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

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

在这个阶段,我想说你要么安装错误,要么命令行奇怪。

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

  • 在操作层面上,是的,两者在大多数情况下可以相互作用。
  • 在编译级别,是的,两者基本上是兼容的(在 0.9.7a 中工作的应该也可以在 0.9.8e 中工作)。
  • 在内部和配置层面,会有细微的差别;例如,最新版本可能支持额外的密码或模式。
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top