[Libwebsockets] Compilation issue

Andy Green andy at warmcat.com
Sat Feb 13 10:51:46 CET 2016

On February 13, 2016 4:58:10 PM GMT+08:00, rahul bhola <me at rahulbhola.in> wrote:
> What is the correct way to include the lib. The current way i am doing
>is using
>g++ -o obj/ws.o -fpic -c src/ws.cc -lwebsockets -I/usr/local/include
>-L/usr/local/lib/libwebsockets.so -std=c++11 -g

You can do that but it's a bit fragile if someone builds your thing later and has installed lws somewhere else.

It's only the default it goes into /usr/local.  You can control the installation dir, see README.build.md

NOTE2: A common option you may want to give is to set the install path, same as --prefix= with autotools. It defaults to /usr/local. You can do this by, eg


NOTE3: On machines that want libraries in lib64, you can also add the following to the cmake line


Then libwebsockets.h is in /usr/include which is already on your compiler -I list.


>I compiler it from source and checked the so , it is showing up in lib.
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list