交叉编译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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...