openssl_api_compat表示不可能的API兼容性级别C++
#Error:“ Openssl_api_compat表示不可能的API兼容性级别”为什么当我导入这2行代码时,它会给我上面的错误?
#define OPENSSL_API_COMPAT 0x10101000L
#include <openssl/sha.h>
#include <openssl/hmac.h>
#error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level" why when I import these 2 lines of code it gives me the error above?
#define OPENSSL_API_COMPAT 0x10101000L
#include <openssl/sha.h>
#include <openssl/hmac.h>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该发生,因为
openssl_api_compat
的值与您包括的OpenSSL标头支持的任何内容都不匹配。在您的情况下,可能的情况可能是系统上已安装的OPENSL的版本为1.1.0或以下。
您可以在触发错误的直线上查看
openssl/macros.h
标头的更多详细信息。您将能够判断它是否发生,因为版本号太高,太低或只是无效。This should be happening because the value of
OPENSSL_API_COMPAT
doesn't match anything that's supported by the openssl header you're including.Likely scenario in your case would be that the installed version of openssl on your system is 1.1.0 or below.
You can find more details about what is happening by peeking at the
openssl/macros.h
header, at the line that triggers the error. You'll be able to tell if it happened because the version number was too high, too low, or just invalid.