[Libwebsockets] build from repo fails

Andy Green andy at warmcat.com
Sun Jun 6 17:58:41 CEST 2021

On June 6, 2021 2:26:15 PM GMT+01:00, Felipe Gasper <felipe at felipegasper.com> wrote:
>	I’m trying to build from the upstream git, but I see this:
>Scanning dependencies of target websockets_shared
>[  1%] Building C object
>In file included from
>In file included from
>In file included from
>      field has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
>        HMAC_CTX ctx;
>                 ^
>/opt/local/include/openssl/ossl_typ.h:102:16: note: forward declaration
>      'struct hmac_ctx_st'
>typedef struct hmac_ctx_st HMAC_CTX;
>               ^
>1 error generated.
>make[2]: ***
>[lib/CMakeFiles/websockets_shared.dir/plat/unix/unix-caps.c.o] Error 1
>make[1]: *** [lib/CMakeFiles/websockets_shared.dir/all] Error 2
>make: *** [all] Error 2
>My OpenSSL is OpenSSL 1.1.1k  (25 Mar 2021), and I’m on macOS Mojave.

That's not related to lws but cmake checking what's in your openssl apis.  Have a look at the second part of this


Lws is built in CI on M1 and intel macs every push, eg


You can see how it configured cmake... you need something similar

cmake .. -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/opt/openssl at 1.1/include '-DLWS_OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib;/usr/local/opt/openssl/lib/libcrypto.dylib'


>	Is this something I could fix?
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list