[Libwebsockets] libwebsockets.h build error with g++

Fredrik Skogman skogman at gmail.com
Wed Feb 28 10:17:42 CET 2018


You are compiling C code with a C++ compiler. C and C++ are different languages and you should not assume they are compatible.

Fredrik

Sent from my iPhone

> On 28 Feb 2018, at 09:31, Chropin Hu <chropinhu at gmail.com> wrote:
> 
> Dear All,
>         I am developing a test program with c++.
>         as following shows,
>         
> #include <libwebsockets.h>
> 
> int main()
> {
> 	return 0;
> }
> 
> but the compile output:
>      g++ -D__GXX_EXPERIMENTAL_CXX0X__ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.cpp"
> In file included from ../main.cpp:9:0:
> /usr/local/include/libwebsockets.h:1818:39: error: expected ‘,’ or ‘...’ before ‘private’
>  lws_jwk_export(struct lws_jwk *s, int private, char *p, size_t len);
> 
> I have checked the libwebsockets.h line 1818:
> lws_jwk_export(struct lws_jwk *s, int private, char *p, size_t len);
> 
> It`s seems that the funtion input param name comflct with c++ key word private.
> 
> It`s a bug or am  i miss soming?
> 
> Yours Chropin
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20180228/8024a341/attachment-0002.html>


More information about the Libwebsockets mailing list