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

Andy Green andy at warmcat.com
Sun Sep 28 22:22:50 CEST 2014

On 29 September 2014 00:03:34 GMT+08:00, satya gowtham kudupudi <satyagowtham.k at gmail.com> wrote:
>I've installed libwebsockets pulled from git.
>I've included /usr/local/include directory where I found
>while compiling my profect I get the above error. I found the struct
>lebwebsocket definition in the privarte-libwebsockets.h source file.
>How to
>install this source file?

There's a private and a public header for a reason.

The public one is our ABI, the 'way to use lws'.

You should not need anything in the private one in your user code.

>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:19: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

I dunno what you have on line 465 but you should be doing it another way.

In linwebsockets.h there are some accessor functions that let you get at struct libwebsocket members cleanly, maybe that can help.


>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list