[Libwebsockets] "<Openssl/ssl.h> not found" error during android compilation

andy at warmcat.com andy at warmcat.com
Sun Jun 28 04:00:08 CEST 2020

On June 27, 2020 9:25:12 PM UTC, Dorian Green <doriangreen97 at gmail.com> wrote:
>Environment: Ubuntu
>zlib 1.2.11
>1. I compiled zlib 1.2.11 for android-16 armeabi-v7a no problem.
>2. I used the "Notes.Android" and compiled openssl-1.1.1g for android

I did this recently to set up 64 bit ndk build in Android with mbedtls and wrote it up here


>3. began configuring libwebsockets, I set DLWS_OPENSSL_LIBRARIES and
>DLWS_OPENSSL_INCLUDE_DIRS everything went well with ./Configure and

Well, cmake...

>related functions and etc were found successfully.
>4. But, during the make process i keep getting. libwebsockets.h:250:10:
>fatal error: 'openssl/ssl.h' file not found
>#include <openssl/ssl.h>
>Things I have tried:
>1. verified my DLWS_OPENSSL_INCLUDE_DIRS and

Correct in that openssl/xxx.h could be found uaing it not xxx.h?

>2. tried including the headers via make

No that is not needed, but that it still doesn't solve it suggests you're missing the point somewhere.

>3. making sure openssl-development headers are installed.

Hm... for cross, what your build machine itself has or doesn't have installed needs to be irrelevant, it should only find cross-built and cross-installed stuff in your cross root.  Headers for x86_64 built local build machine openssl are illegal poison for your cross build.

>What i am expecting:
>Just looking for general pointers or ideas as to how to resolve this
>thanks you for reading :)

Not enough info... however what I documented in the readme I pointed to works fine vs mbedtls, eg,


I would carefully align the cmake toolchain file you're using to the 64-bit one I use in the readme and look at how that handles cross- install and cross root.


More information about the Libwebsockets mailing list