[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
>Android-ndk-r21d
>libwebsockets-4.0.19
>openssl-1.1.1g
>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
>no
>problem.

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

https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.build-android.md

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

Well, cmake...

>openssl
>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?

 DLWS_OPENSSL_LIBRARIES are
>correct.
>2. tried including the headers via make
>-I/and_the_path_to_the_openssl_headers.

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
>issue,
>thanks you for reading :)

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

https://libwebsockets.org/sai/index.html?task=2916b3a4a05343d20a5255aef5f2430682ed0ca3a33f01db3d42961b4828c1d4

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.

-Andy



More information about the Libwebsockets mailing list