Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libwebsockets make fails with error: conflicting types for ‘lws_tls_server_abort_connection #219

Closed
Jeansen opened this issue Feb 15, 2024 · 4 comments · Fixed by #234
Closed

Comments

@Jeansen
Copy link

Jeansen commented Feb 15, 2024

Followed the main documentation, but when I run make after the cmake command for libwebsockets, I get the following error:

/tmp/k/libwebsockets/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 /tmp/k/libwebsockets/lib/tls/./private-lib-tls.h:138,
                 from /tmp/k/libwebsockets/lib/core/./private-lib-core.h:262,
                 from /tmp/k/libwebsockets/lib/tls/openssl/openssl-server.c:25:
/tmp/k/libwebsockets/lib/tls/./private-network.h:167:1: note: previous declaration of ‘lws_tls_server_abort_connection’ with type ‘enum lws_ssl_capable_status(struct lws *)’
  167 | lws_tls_server_abort_connection(struct lws *wsi);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as 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:1260: lib/CMakeFiles/websockets.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
#cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux trixie/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=trixie
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
#uname -a
Linux omph-laptop 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.15-2 (2024-02-04) x86_64 GNU/Linux

@ityuhui
Copy link
Member

ityuhui commented Feb 17, 2024

The build on Ubuntu 22.04.3 LTS works.

I guess the GCC on your env Debian 6.6.15-2 (2024-02-04) can not compile libwebsockets v4.2-stable

So can you try building the latest version of libwebsockets? I think client-c will work with the latest libwebsockets (But I haven't tested it before).

@Jeansen
Copy link
Author

Jeansen commented Feb 17, 2024

Hey @ityuhui Thanks for the quick reply. It works on Debian bookworm and you might be correct. I'll try your hint. Also, maybe you could update the README. I also had to install packages like make cmake build-essential.

@homer6
Copy link
Contributor

homer6 commented Feb 27, 2024

I had this issue on Ubuntu 23.10, and the fix for me was to pull from main instead of this branch:

Docs say:

git clone https://github.com/warmcat/libwebsockets --depth 1 --branch v4.2-stable

Fix:

git clone https://github.com/warmcat/libwebsockets

@ityuhui
Copy link
Member

ityuhui commented Feb 28, 2024

It's great. Thank you all for the information. We can update the document to bump to the latest release version.

But I want to try sudo apt-get install libwebsockets-dev first. I think a compatible version of libwebsockets is now in the Debian and Ubuntu apt repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants