Problems with building the "libwebsockets"

lydex@vbox:~/Downloads/libwebsockets-4.3.0-14/ build$ sudo make && sudo make install
[ 0%] Creating build include dir
[ 0%] Built target GENHDR
[ 0%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-caps.c.o
[ 1%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-misc.c.o
[ 1%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-init.c.o
[ 2%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-file.c.o
[ 3%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-pipe.c.o
[ 3%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-service.c.o
[ 4%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-sockets.c.o
[ 4%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-fds.c.o
[ 5%] Building C object lib/CMakeFiles/websockets.dir/tls/tls.c.o
[ 5%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-network.c.o
[ 6%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-sessions.c.o
[ 7%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-tls.c.o
[ 7%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-x509.c.o
[ 8%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-ssl.c.o
[ 8%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-session.c.o
[ 9%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-server.c.o
[ 9%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-server.c.o
/home/lydex/Downloads/libwebsockets-4.3.0-14/ lib/tls/openssl/openssl-server.c:683:1: error: conflicting types for “lws_tls_server_abort_connection” due to enum/integer mismatch; have “int(struct lws *)” [-Werror=enum-int-mismatch]
683 | lws_tls_server_abort_connection(struct lws *wsi)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/lydex/Downloads/libwebsockets-4.3.0-14/ lib/tls/./private-lib-tls.h:143,
from /home/lydex/Downloads/libwebsockets-4.3.0-14/ lib/core/./private-lib-core.h:265,
from /home/lydex/Downloads/libwebsockets-4.3.0-14/ lib/tls/openssl/openssl-server.c:25:
/home/lydex/Downloads/libwebsockets-4.3.0-14/ lib/tls/./private-network.h:171:1: remark: previous declaration of “lws_tls_server_abort_connection” with type “enum lws_ssl_capable_status(struct lws *)”
171 | lws_tls_server_abort_connection(struct lws *wsi);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings are considered errors
make[2]: *** [lib/CMakeFiles/websockets.dir/build.make:300: lib/CMakeFiles/websockets.dir/tls/openssl/openssl-server.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1284:lib/CMakeFiles/websockets.dir/all] Error 2
make: *** [Makefile:166:all] Error 2

Latest libwebsockets version is 4.3.3:

1 Like

… except Ardour binaries do indeed use libwebsockets 4.3.0-14. Yet likely the compiler you use is a lot more picky, and Werror is toolchain dependent.

1 Like

And how can i fix problem with my compiler? I’m using the gcc/g++ and I don’t see any reason for problems to arise (because gcc is recommended builder)

We use gcc (Debian 10.2.1-6) 10.2.1 20210110 and configure it to not use Werror:

cmake -DLWS_WITH_SSL=OFF -DLWS_WITH_GLIB=ON \
      -DLWS_WITHOUT_TEST_SERVER=ON -DLWS_WITHOUT_TESTAPPS=ON \
      -DDISABLE_WERROR=ON -DLWS_WITH_EVLIB_PLUGINS=OFF \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_C_FLAGS="-O3 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" \

(and also set `-DCMAKE_INSTALL_PREFIX)

In any case you’ll be fine with a more modern version of libwebsockets. That won’t break anything. In fact we should probably update the version we use.

1 Like

Ok, thanks for the answer :blush:, i’ll use the dev-version