<tfoot id='sm2li'></tfoot><legend id='sm2li'><style id='sm2li'><dir id='sm2li'><q id='sm2li'></q></dir></style></legend>
  • <small id='sm2li'></small><noframes id='sm2li'>

  • <i id='sm2li'><tr id='sm2li'><dt id='sm2li'><q id='sm2li'><span id='sm2li'><b id='sm2li'><form id='sm2li'><ins id='sm2li'></ins><ul id='sm2li'></ul><sub id='sm2li'></sub></form><legend id='sm2li'></legend><bdo id='sm2li'><pre id='sm2li'><center id='sm2li'></center></pre></bdo></b><th id='sm2li'></th></span></q></dt></tr></i><div id='sm2li'><tfoot id='sm2li'></tfoot><dl id='sm2li'><fieldset id='sm2li'></fieldset></dl></div>
          <bdo id='sm2li'></bdo><ul id='sm2li'></ul>

        错误:在 C++ 项目中使用 HMAC_CTX 时类型不完整

        时间:2024-08-14
          <i id='TsRpr'><tr id='TsRpr'><dt id='TsRpr'><q id='TsRpr'><span id='TsRpr'><b id='TsRpr'><form id='TsRpr'><ins id='TsRpr'></ins><ul id='TsRpr'></ul><sub id='TsRpr'></sub></form><legend id='TsRpr'></legend><bdo id='TsRpr'><pre id='TsRpr'><center id='TsRpr'></center></pre></bdo></b><th id='TsRpr'></th></span></q></dt></tr></i><div id='TsRpr'><tfoot id='TsRpr'></tfoot><dl id='TsRpr'><fieldset id='TsRpr'></fieldset></dl></div>
            <tbody id='TsRpr'></tbody>

            1. <legend id='TsRpr'><style id='TsRpr'><dir id='TsRpr'><q id='TsRpr'></q></dir></style></legend>
              <tfoot id='TsRpr'></tfoot>
            2. <small id='TsRpr'></small><noframes id='TsRpr'>

                  <bdo id='TsRpr'></bdo><ul id='TsRpr'></ul>

                  本文介绍了错误:在 C++ 项目中使用 HMAC_CTX 时类型不完整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试编译这个库 ndn-cxx在我的笔记本电脑中.我已经在另一台计算机上尝试过,它编译成功,但现在我收到了这个错误,我认为它与 openssl 相关.我使用 sudo apt-cache search libssl | 验证我的笔记本电脑中是否有 openssl |grep SSL 结果是:

                  I am trying to compile this library ndn-cxx in my laptop. I already tried in another computer and it compiled successfully but now i am getting this error and i think its related somhow to openssl. I verify that i have openssl in my laptop using sudo apt-cache search libssl | grep SSL and the result is :

                  • libssl-ocaml - OpenSSL 的 OCaml 绑定(运行时)
                  • libssl-ocaml-dev - OpenSSL 的 OCaml 绑定
                  • libssl0.9.8 - SSL 共享库
                  • libsslcommon2 - 企业消息传递系统 - 通用 SSL 库
                  • libsslcommon2-dev - 企业消息系统 - 通用 SSL 开发文件

                  我在尝试编译库时遇到的错误是:

                  ../src/security/transform/hmac-filter.cpp:49:12: error: field ‘m_context’ has incomplete type
                     HMAC_CTX m_context;
                              ^
                  
                  ../src/security/transform/hmac-filter.cpp: In constructor 
                  ‘ndn::security::transform::HmacFilter::Impl::Impl()’:
                  ../src/security/transform/hmac-filter.cpp:35:20: error: ‘m_context’ was not declared in this scope
                       HMAC_CTX_init(&m_context);
                                      ^
                  
                  ../src/security/transform/hmac-filter.cpp:35:29: error: ‘HMAC_CTX_init’ was not declared in this scope
                       HMAC_CTX_init(&m_context);
                                               ^
                  
                  ../src/security/transform/hmac-filter.cpp: In destructor ‘ndn::security::transform::HmacFilter::Impl::~Impl()’:
                  ../src/security/transform/hmac-filter.cpp:40:23: error: ‘m_context’ was not declared in this scope
                       HMAC_CTX_cleanup(&m_context);
                                         ^    
                  
                  ../src/security/transform/hmac-filter.cpp:40:32: error: ‘HMAC_CTX_cleanup’ was not declared in this scope
                       HMAC_CTX_cleanup(&m_context);
                                                  ^
                  
                  ../src/security/transform/hmac-filter.cpp: In member function ‘ndn::security::transform::HmacFilter::Impl::operator HMAC_CTX*()’:
                  ../src/security/transform/hmac-filter.cpp:45:13: error: ‘m_context’ was not declared in this scope
                       return &m_context;
                               ^
                  
                  ../src/security/transform/hmac-filter.cpp:46:3: warning: control reaches end of non-void function [-Wreturn-type]
                     }
                     ^
                  

                  推荐答案

                  导致编译错误的文件 包含行 #if OPENSSL_VERSION_NUMBER <0x1010000fL 并在这种情况下使用结构 HMAC_CTX.对于较新版本的 OpenSSL (>1.1.0),它使用 HMAX_CTX *.我的结论是 waf 构建工具包含错误的文件来获取 OPENSSL_VERSION_NUMBER 并因此编译就像您使用旧版本的 OpenSSL 一样,结构为 HMAC_CTX,在较新的版本中不再可用.

                  The file that causes the compilation error contains the line #if OPENSSL_VERSION_NUMBER < 0x1010000fL and uses the struct HMAC_CTX in that case. For newer versions of OpenSSL (>1.1.0), it uses HMAX_CTX *. My conclusion is that the waf build tool includes the wrong file to get the OPENSSL_VERSION_NUMBER and consequently compiles as if you are using an older version of OpenSSL, with the struct HMAC_CTX, which is no longer available as such in the newer versions.

                  您可以执行 grep OPENSSL .waf-tools/openssl.py 并分析打印的行以查看不同 OpenSSL 包含的来源.

                  You could do grep OPENSSL .waf-tools/openssl.py and analyse the printed lines to see where the different OpenSSL includes come from.

                  这篇关于错误:在 C++ 项目中使用 HMAC_CTX 时类型不完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Visual Studio 2012 中使用 OpenSSL 下一篇:如何在没有 p、q 等的情况下加载 RSA 密钥对

                  相关文章

                  <legend id='4asuG'><style id='4asuG'><dir id='4asuG'><q id='4asuG'></q></dir></style></legend>

                      • <bdo id='4asuG'></bdo><ul id='4asuG'></ul>
                      <tfoot id='4asuG'></tfoot>

                      <small id='4asuG'></small><noframes id='4asuG'>

                      <i id='4asuG'><tr id='4asuG'><dt id='4asuG'><q id='4asuG'><span id='4asuG'><b id='4asuG'><form id='4asuG'><ins id='4asuG'></ins><ul id='4asuG'></ul><sub id='4asuG'></sub></form><legend id='4asuG'></legend><bdo id='4asuG'><pre id='4asuG'><center id='4asuG'></center></pre></bdo></b><th id='4asuG'></th></span></q></dt></tr></i><div id='4asuG'><tfoot id='4asuG'></tfoot><dl id='4asuG'><fieldset id='4asuG'></fieldset></dl></div>