Cross Compile docker libwebsockets.h not found mosquitto



  • Hi,

    new to this, i followed the 20171003 Blog entry about docker cross compile.
    docker install ok.
    docker run ok.
    but make stops after a while with this error:
    ...
    make[3] -C feeds/packages/net/mosquitto compile
    make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
    /root/source/include/toplevel.mk:198: recipe for target 'world' failed
    make: *** [world] Error 1
    and make -j1 -V=s delivers:
    ...
    make[5]: Entering directory '/root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14/src'
    mipsel-openwrt-linux-musl-gcc -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /root/source/build_dir/target-mipsel_24kc_musl-1.1.16/mosquitto-ssl/mosquitto-1.4.14:mosquitto-1.4.14 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/usr/include -I/root/source/staging_dir/target-mipsel_24kc_musl-1.1.16/include -I/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/usr/include -I/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/fortify -I/root/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include -I. -I.. -I../lib -DVERSION=""1.4.14"" -DTIMESTAMP=""2017-10-04 15:25:51+0000"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_WEBSOCKETS -DWITH_EC -c mosquitto.c -o mosquitto.o
    mosquitto.c:47:29: fatal error: libwebsockets.h: No such file or directory
    compilation terminated.
    Makefile:15: recipe for target 'mosquitto.o' failed
    make[5]: *** [mosquitto.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/toplevel.mk:198: recipe for target 'world' failed
    make: *** [world] Error 2
    Seems like the dependency of mosquitto to libwebsockets is not (yet) fulfilled.
    What could be done here?



  • @thor42 I'm having the same error, on Ubuntu 16.04.



  • @thor42 said in Cross Compile docker libwebsockets.h not found mosquitto:

    libwebsockets.h

    So far what i undestand the docker image lack the software libwebsockets available from https://github.com/warmcat/libwebsockets

    So i can download it to the docker, but unable to get it to compile it yet.



  • 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/toplevel.mk:198: recipe for target 'world' failed
    make: *** [world] Error 2
    root@7cac80aeef0e:~/source#




  • I compiled LEDE in docker on a MacBook Pro according to this tutorial: https://onion.io/2bt-cross-compiling-c-programs-part-1/

    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.



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