[Libwebsockets] Integrate new file into libwebsocket make build system

Edwin van den Oetelaar oetelaar.automatisering at gmail.com
Sat Nov 23 00:15:10 CET 2013

Hello Hemant,

The usual procedure is to build and install the library and use it as such.
You would make a new project and
#include <libwebsockets.h>

and then link to the library to build the final binary. (using -l flag)
gcc myapp.c -o myapp -lwebsockets

Working inside the library directory is not the normal way.

Edwin van den Oetelaar

On Fri, Nov 22, 2013 at 11:54 PM, Hemant Kumar <andy.green at linaro.org>wrote:

>  Hi
> I am trying to add a new source file into libwebsocket build system.
> I am using libwebsocket_write() and  related APIs mentioned in
> libwebsocket.c  in my source code and have included the following files.
> Also, I am trying to reference the sock variable defines inside struct
> libwebsocket , which is in turn is defined in private-libwebsocket.h  .
> #include "../lib/private-libwebsockets.h"
> #include <libwebsockets.h>
> My source file is placed under test-server directory , I end up with
> following error when I use gcc separately to compile the file:
> gcc  -Wall  -I/home/hkumar/libwebsockets/lib/
> -L/home/hkumar/libwebsockets/build/lib/  traffic_client.c
> traffic_client_send.c  -lrt  -o trafficclient
> In file included from traffic_client.c:18:
> ../lib/private-libwebsockets.h:29:20: error: config.h: No such file or
> directory
> In file included from traffic_client_send.c:13:
> ../lib/private-libwebsockets.h:29:20: error: config.h: No such file or
> directory
> I do not see any config.h in lib directory which means that it might be
> taken care by libwebsocket cmake build utility.
> Can you please suggest, how I can add my new source file and compile it
> successfully?
> Thanks
> Hemant
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20131123/dba9bf0e/attachment-0001.html>

More information about the Libwebsockets mailing list