[ 66%] Building CXX object proxy_ws/CMakeFiles/proxy_lws.dir/proxy_lws.cpp.o
In file included from /vagrant/include/libwebsockets.h:600,
from /vagrant/proxy_ws/proxy_lws_utils.hpp:12,
from /vagrant/proxy_ws/proxy_lws.cpp:18:
/vagrant/include/libwebsockets/lws-genhash.h:80:18: error: field ‘ctx’ has incomplete type ‘HMAC_CTX’ {aka ‘hmac_ctx_st’}
80 | HMAC_CTX ctx;
| ^~~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/comp.h:16,
from /usr/include/openssl/ssl.h:17,
from /vagrant/include/libwebsockets.h:250,
from /vagrant/proxy_ws/proxy_lws_utils.hpp:12,
from /vagrant/proxy_ws/proxy_lws.cpp:18:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of ‘HMAC_CTX’ {aka ‘struct hmac_ctx_st’}
104 | typedef struct hmac_ctx_st HMAC_CTX;
| ^~~~~~~~~~~
应用程序代码现在必须使用指针,并且不能直接在堆栈上分配对象。例如,如果旧代码这样做:
BN_CTX ctx;
你现在必须做:
BN_CTX *ctx;
ctx = BN_CTX_new();
[...]
BN_CTX_free(ctx);
所以这是你问题的起点。您很可能需要将 ctx 声明为指针并在堆上分配内存。
但是请注意,您可能会遇到更多问题。鉴于更新库的全部前提是提高安全性,您现在必须通过“getter”和“setter”操作该结构中的数据。