字段‘ctx’的类型不完全问题 解决笔记

533 阅读1分钟

libwebsockets/lws-genhash.h:80:18: 错误:字段‘ctx’的类型不完全\
         HMAC_CTX ctx;\
                  ^~~

grep -r include_directories libwebsockets/ | grep open

     libwebsockets/CMakeLists.txt:   include_directories(lib/tls/mbedtls/wrapper/include/openssl)

./libwebsockets/lib/tls/mbedtls/wrapper/include/openssl/ssl.h

make -C libwebsockets/build/ -f mkfile

make clean -C libwebsockets/build/ -f mkfile

[HMAC_CTX ctx has incomplete type · Issue #353 · butor/blackbird · GitHub](https://github.com/butor/blackbird/issues/353 "HMAC_CTX ctx has incomplete type · Issue #353 · butor/blackbird · GitHub")

I am having the same or similar issue on Windows:\
Slightly different, instead of using command line -D definitions I declared it in CMakeLists.txt:

set (OPENSSL_ROOT_DIR "/lib/openssl-1.1.0g")\
set (OPENSSL_CRYPTO_LIBRARY "/lib/openssl-1.1.0g/lib")\
set (OPENSSL_SSL_LIBRARY "/lib/openssl-1.1.0g/lib")\
set (OPENSSL_INCLUDE_DIR "/lib/openssl-1.1.0g/include")

`-DOPENSSL_INCLUDE_DIR=/usr/include/openssl -DOPENSSL_SSL_LIBRARY=/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0`

for debian 9.x and may be install `libssl1.0-dev`

[root@localhost ~]# ls -al /usr/include/openssl\
lrwxrwxrwx 1 root root 44 12月 17 2020 /usr/include/openssl -> /usr/cntlcenter/libs/openssl/include/openssl

unlink /usr/include/openssl

[root@localhost ~]# rpm -qa |grep openssl                               \
xmlsec1-openssl-1.2.20-7.el7_4.x86_64\
openssl-libs-1.0.2k-19.el7.ns7.02.x86_64\
openssl-1.0.2k-19.el7.ns7.02.x86_64

yum remove openssl-devel-1.0.2k-19.el7.ns7.02.x86_64

yum install openssl-devel-1.0.2k-19.el7.ns7.02.x86_64

[root@localhost ~]# rpm -qf /usr/include/openssl/ssl.h        \
openssl-devel-1.0.2k-19.el7.ns7.02.x86_64



​