Cross Compile docker libwebsockets.h not found mosquitto

  • after running "make menu config" i went down to "libraries" then selected "libwebsockets"
    It went further this time but stopped at another error:

    loop.c: In function 'loop_handle_reads_writes':
    loop.c:492:22: error: storage size of 'wspoll' isn't known
    struct lws_pollfd wspoll;
    loop.c:496:4: warning: implicit declaration of function 'lws_service_fd' [-Wimplicit-function-declaration]
    lws_service_fd(lws_get_context(context->wsi), &wspoll);
    loop.c:496:19: warning: implicit declaration of function 'lws_get_context' [-Wimplicit-function-declaration]
    lws_service_fd(lws_get_context(context->wsi), &wspoll);
    Makefile:33: recipe for target 'loop.o' failed
    make[5]: *** [loop.o] Error 1
    make[5]: Leaving directory '/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14/src'
    Makefile:21: recipe for target 'mosquitto' failed
    make[4]: *** [mosquitto] Error 2
    make[4]: Leaving directory '/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14'
    Makefile:223: recipe for target '/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14/.built' failed
    make[3]: *** [/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14/.built] Error 2
    make[3]: Leaving directory '/root/source/feeds/packages/net/mosquitto'
    package/Makefile:105: recipe for target 'package/feeds/packages/mosquitto/compile' failed
    make[2]: *** [package/feeds/packages/mosquitto/compile] Error 2
    make[2]: Leaving directory '/root/source'
    package/Makefile:101: recipe for target '/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile' failed
    make[1]: *** [/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile] Error 2
    make[1]: Leaving directory '/root/source'
    /root/source/include/ recipe for target 'world' failed
    make: *** [world] Error 2

  • I compiled LEDE in docker on a MacBook Pro according to this tutorial:

    I had the same problem but got around it by disabling the libwebsocket support for mosquitto-ssl (under the topic 'Network')

  • Finally got rid of the error
    i ran "make defconfig",
    the "make menuconfig" to reselect the options i wanted and all is good now.

  • Has anyone actually gotten libwebsockets and mosquitto to compile (cross compiled) onto the omega2+ successfully?

    Im trying for days and no luck. Any help would be appreciated.

  • administrators

    For now, the only way to compile the Build system is to un-select mosquitto and libwebsockets packages from the menuconfig. 0_1519767258955_mqtt_menuconfig.PNG


    This is what it looks in the menu. You can search the package using / and enter the desired package to be removed (e.g. mosquitto). You will also be able to see the location where you can locate it.

  • there is no possibility to uncheck mosquito. It's either [M] or [*]. Pressing space and <N> doesn't work. libwebsockets is unchecked by default:

    short video example

  • I used vi to comment out all references to mosquitto in .config. Just search for mosquitto, there are a number of lines.
    ~/source# vi .config

  • administrators

    An update on this topic:
    Many users have reported this issue with libwebsockets and mosquitto when running our Docker build system image on Windows and Mac OS.
    We recommend running the Docker build system image on a Linux system. That's how we build firmware at Onion and it don't see these issues.

    Happy hacking!

  • Hi @Lazar-Demin,

    It's probably worth mentioning the linux distro as well. I have came at this from a lot of different angles:

    Onion's Docker on Windows
    Ubuntu 16 VM Windows Host machine
    Onion's Docker on Ubuntu 16 VM Windows Host machine

    Onion's Docker on Centos 7 (Eventually worked!)

    From what I saw in my debugging there was a 502 timeout when trying to download the libwebsockets dependency, therefor failing the build.

    My fix was no different than the aforementioned, but my question to you is that worth a PR to GH repo? I can submit mine.

    Thank you kindly,
    -- Kade

  • Here is my fork:

    Clone, startup docker, then:

    # cd /root/source/c-cross-compile-example //
    # sh --buildroot /root/source/ --lib ugpio

  • I'm having this same issue on Linux Mint 19 using the docker image.

  • @Lazar-Demin seeing the same thing running Parallels with ubuntu.

    I did find that libwebsockets was unchecked. Checking it got me further, but I still can not build, on MacOS or Ubuntu, same errors as everyone else with mosquitto and SSLlibwebsockets

  • I got the same on ubuntu 18.04 LTS. Deleting the container and rebuilding in a NEW container fixed the issue, when I tried for the 3rd time.

Looks like your connection to Community was lost, please wait while we try to reconnect.