[Libwebsockets] Compile error Windows, MSVC++ 2010

Andy Green andy at warmcat.com
Mon Dec 15 08:12:06 CET 2014



On 15 December 2014 15:02:11 GMT+08:00, Chris Hanson <xenon at alphapixel.com> wrote:
>I'm encountering the error below trying to build WITH_SSL and not
>WITH_LIBEV on VS2010, 32-bit, Windows.
>
>It appears to be choking on the line
>
>struct libwebsocket_context *context = wsi->protocol->owning_server;
>
>basically saying that the libwebsocket_context type is not defined.
>
>Which is bizarre, because it works higher up in the same file. I have
>found
>that above line 77:
>
>lws_libev_io(context, wsi, LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE);
>
>this line of code compiles fine.

I looked at the code and it has got mixed declarations and code which is not nice.  Maybe the MS compiler got confused.

I unmixed it here

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=4edb452969caa507834061d097bc88ea9dc88f1f

give that a try.

-Andy

>I don't use libev, but it seems like the lws_libev_io call is not
>properly
>being compiled out in the event that I lack libev.
>
>  Is libev even available for Windows? Is there a way to get this to
>compile properly?
>
>
>1>------ Build started: Project: websockets, Configuration: Debug Win32
>------
>1>Build started 12/14/2014 11:55:48 PM.
>1>ClCompile:
>1>  pollfd.c
>1>..\libwebsockets\lib\pollfd.c(136): error C2143: syntax error :
>missing
>';' before 'type'
>1>..\libwebsockets\lib\pollfd.c(137): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(139): error C2143: syntax error :
>missing
>';' before 'type'
>1>..\libwebsockets\lib\pollfd.c(140): error C2143: syntax error :
>missing
>';' before 'type'
>1>..\libwebsockets\lib\pollfd.c(141): error C2143: syntax error :
>missing
>';' before 'type'
>1>..\libwebsockets\lib\pollfd.c(142): error C2143: syntax error :
>missing
>';' before 'type'
>1>..\libwebsockets\lib\pollfd.c(144): error C2065: 'pfd' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(144): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(144): error C2223: left of '->fds' must
>point to struct/union
>1>..\libwebsockets\lib\pollfd.c(145): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(145): error C2224: left of '.fd' must
>have
>struct/union type
>1>..\libwebsockets\lib\pollfd.c(147): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(147): error C2223: left of
>'->protocols'
>must point to struct/union
>1>..\libwebsockets\lib\pollfd.c(147): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(148): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(150): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(150): error C2224: left of
>'.prev_events'
>must have struct/union type
>1>..\libwebsockets\lib\pollfd.c(150): error C2065: 'pfd' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(150): error C2223: left of '->events'
>must
>point to struct/union
>1>..\libwebsockets\lib\pollfd.c(151): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(151): error C2224: left of '.events'
>must
>have struct/union type
>1>..\libwebsockets\lib\pollfd.c(151): error C2065: 'pfd' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(151): error C2223: left of '->events'
>must
>point to struct/union
>1>..\libwebsockets\lib\pollfd.c(151): error C2065: 'pfd' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(151): error C2223: left of '->events'
>must
>point to struct/union
>1>..\libwebsockets\lib\pollfd.c(153): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(153): error C2223: left of
>'->protocols'
>must point to struct/union
>1>..\libwebsockets\lib\pollfd.c(153): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(155): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(164): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(164): error C2224: left of
>'.prev_events'
>must have struct/union type
>1>..\libwebsockets\lib\pollfd.c(164): error C2065: 'pa' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(164): error C2224: left of '.events'
>must
>have struct/union type
>1>..\libwebsockets\lib\pollfd.c(166): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(166): warning C4047: 'function' :
>'libwebsocket_context *' differs in levels of indirection from 'int'
>1>..\libwebsockets\lib\pollfd.c(166): warning C4024:
>'lws_plat_change_pollfd' : different types for formal and actual
>parameter 1
>1>..\libwebsockets\lib\pollfd.c(166): error C2065: 'pfd' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(166): warning C4047: 'function' :
>'libwebsocket_pollfd *' differs in levels of indirection from 'int'
>1>..\libwebsockets\lib\pollfd.c(166): warning C4024:
>'lws_plat_change_pollfd' : different types for formal and actual
>parameter 3
>1>..\libwebsockets\lib\pollfd.c(171): error C2065: 'sampled_tid' :
>undeclared identifier
>1>..\libwebsockets\lib\pollfd.c(171): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(171): error C2223: left of
>'->service_tid'
>must point to struct/union
>1>..\libwebsockets\lib\pollfd.c(172): error C2065: 'sampled_tid' :
>undeclared identifier
>1>..\libwebsockets\lib\pollfd.c(173): error C2065: 'tid' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(173): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(173): error C2223: left of
>'->protocols'
>must point to struct/union
>1>..\libwebsockets\lib\pollfd.c(173): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(175): error C2065: 'tid' : undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(175): error C2065: 'sampled_tid' :
>undeclared identifier
>1>..\libwebsockets\lib\pollfd.c(176): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(176): warning C4047: 'function' :
>'libwebsocket_context *' differs in levels of indirection from 'int'
>1>..\libwebsockets\lib\pollfd.c(176): warning C4024:
>'libwebsocket_cancel_service' : different types for formal and actual
>parameter 1
>1>..\libwebsockets\lib\pollfd.c(180): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(180): error C2223: left of
>'->protocols'
>must point to struct/union
>1>..\libwebsockets\lib\pollfd.c(180): error C2065: 'context' :
>undeclared
>identifier
>1>..\libwebsockets\lib\pollfd.c(181): error C2065: 'pa' : undeclared
>identifier
>1>
>1>Build FAILED.
>1>
>1>Time Elapsed 00:00:00.38
>========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>==========




More information about the Libwebsockets mailing list