[Libwebsockets] /usr/local/include/libwebsockets.h:487:8: error: forward declaration of ‘struct libwebsocket’

Roger Light roger at atchoo.org
Mon Sep 29 18:43:01 CEST 2014


Hi Gowtham,

Try using libwebsocket_get_socket_fd() instead. As Andy already said,
you should use accessor functions because the internals of that struct
is private.

Cheers,

Roger



On Mon, Sep 29, 2014 at 5:39 PM, satya gowtham kudupudi
<andy.green at linaro.org> wrote:
> Thanks for the libwebsockets library and your help!
>
> I'm using struct libwebsocket to get the socket its using
> libwebsocket::sock. Here are the compiling commands that are producing the
> error.
>
> g++    -c -g -D_DEBUG -I. -I/usr/local/include -I/usr/include/ferryfair
> -std=c++11 -MMD -MP -MF "build/Debug/GNU-Linux-x86/WSServer.o.d" -o
> build/Debug/GNU-Linux-x86/WSServer.o WSServer.cpp
> In file included from FerryStream.h:18:0,
>                  from WSServer.cpp:47:
> WSServer.cpp: In static member function ‘static int
> WSServer::callbackFairPlayWS(libwebsocket_context*, libwebsocket*,
> libwebsocket_callback_reasons, void*, void*, size_t)’:
> WSServer.cpp:465:83: error: invalid use of incomplete type ‘struct
> libwebsocket’
>              ffl_notice(FPL_WSSERV, "viewer %s:%d connected",
> Socket::getIpAddr(wsi->sock).c_str(), Socket::getPort(wsi->sock));
>
> ^
> /usr/include/ferryfair/base/logger.h:41:72: note: in definition of macro
> ‘ffl_notice’
>  #define ffl_notice(level,...) _ff_log(__FUNCTION__, FFL_NOTICE, level,
> __VA_ARGS__)
>                                                                         ^
> In file included from WSServer.h:16:0,
>                  from WSServer.cpp:49:
> /usr/local/include/libwebsockets.h:487:8: error: forward declaration of
> ‘struct libwebsocket’
>  struct libwebsocket;
>         ^
> In file included from FerryStream.h:18:0,
>                  from WSServer.cpp:47:
> WSServer.cpp:465:119: error: invalid use of incomplete type ‘struct
> libwebsocket’
>              ffl_notice(FPL_WSSERV, "viewer %s:%d connected",
> Socket::getIpAddr(wsi->sock).c_str(), Socket::getPort(wsi->sock));
>
> ^
> /usr/include/ferryfair/base/logger.h:41:72: note: in definition of macro
> ‘ffl_notice’
>  #define ffl_notice(level,...) _ff_log(__FUNCTION__, FFL_NOTICE, level,
> __VA_ARGS__)
>                                                                         ^
> In file included from WSServer.h:16:0,
>                  from WSServer.cpp:49:
> /usr/local/include/libwebsockets.h:487:8: error: forward declaration of
> ‘struct libwebsocket’
>
> --
> Gowtham
>
>
>
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>



More information about the Libwebsockets mailing list