微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

交叉编译libwebsockets时,字段'ctx'有不完整的类型错误

如何解决交叉编译libwebsockets时,字段'ctx'有不完整的类型错误

我正在尝试为 arm 交叉编译 libwebsockets。我将 OpenSSL 和 Zlib 路径放在 CMakefiles.txt 中。 但是在命令“make”之后,它会出错。

CMakefiles.txt 中的 OpenSSL 和 Zlib 路径设置

SET(ZLIB_INCLUDE_DIR /home/jacob/Workspace/lib/zlib/include)
SET(ZLIB_LIBRARY /home/jacob/Workspace/lib/zlib/lib/libz.so)

set(OPENSSL_ROOT_DIR /home/jacob/Workspace/lib/openssl/)
set(OPENSSL_CRYPTO_LIBRARY /home/jacob/Workspace/lib/openssl/lib/libcrypto.so)
set(OPENSSL_INCLUDE_DIR /home/jacob/Workspace/lib/openssl/include/)
set(OPENSSL_LIBRARIES /home/jacob/Workspace/lib/openssl/lib/)
set(OPENSSL_SSL_LIBRARY /home/jacob/Workspace/lib/openssl/lib/libssl.so)

输入“make”命令时的错误

jacob@ubuntu:~/Workspace/Github/libwebsockets/build$ make
Scanning dependencies of target GENHDR
[  1%] Creating build include dir
[  1%] Built target GENHDR
Scanning dependencies of target websockets
[  2%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-caps.c.o
In file included from /home/jacob/Workspace/Github/libwebsockets/include/libwebsockets.h:632,from /home/jacob/Workspace/Github/libwebsockets/lib/core/./private-lib-core.h:140,from /home/jacob/Workspace/Github/libwebsockets/lib/plat/unix/unix-caps.c:28:
/home/jacob/Workspace/Github/libwebsockets/include/libwebsockets/lws-genhash.h:85:18: error: field ‘ctx’ has incomplete type
   85 |         HMAC_CTX ctx;
      |                  ^~~
lib/CMakeFiles/websockets.dir/build.make:62: recipe for target 'lib/CMakeFiles/websockets.dir/plat/unix/unix-caps.c.o' Failed
make[2]: *** [lib/CMakeFiles/websockets.dir/plat/unix/unix-caps.c.o] Error 1
CMakeFiles/Makefile2:1068: recipe for target 'lib/CMakeFiles/websockets.dir/all' Failed
make[1]: *** [lib/CMakeFiles/websockets.dir/all] Error 2
Makefile:162: recipe for target 'all' Failed
make: *** [all] Error 2

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。