Mosquitto: libwebsockets.h missing from the src directory

Created on 12 Oct 2017  路  8Comments  路  Source: eclipse/mosquitto

Header file libwebsockets.h is not found in the pacakge.

compile fails as it is needed by these files.

loop.c
mosquito.c
mosquitto_broker.h
read_handle_server.c
websockets.c

not a bug

Most helpful comment

How I built libwebsockets before building mosquitto...if it is of any use to anyone...

git clone -b v2.4.1 https://github.com/warmcat/libwebsockets.git
cd libwebsockets
mkdir build
cd build
cmake .. -DLIB_SUFFIX=64
make
make install

After this, build mosquitto

All 8 comments

It's normal. You must install libwebsockets package on ubuntu distribution.

@Tifaifai is right that mosquitto is normal.
@Yvanttt, generally, you must install the development package to compile with the library.
For libwebsockets, you must prepare the development package named as libwebsocket-dev or libwebsocket-devel.

How I built libwebsockets before building mosquitto...if it is of any use to anyone...

git clone -b v2.4.1 https://github.com/warmcat/libwebsockets.git
cd libwebsockets
mkdir build
cd build
cmake .. -DLIB_SUFFIX=64
make
make install

After this, build mosquitto

You can find libwebsockets.h in libwebsockets/lib while not in mosquitto.

Do you make a cross compilation ?
In my case, i have rewrite 'config.mk' and modify the file with for libwebsockets, for example :

ifeq ($(WITH_WEBSOCKETS),yes)
  BROKER_CFLAGS:=$(BROKER_CFLAGS) -I/opt/crosstool-ng/arm-linux-gnueabi/include -I/opt/libwebsockets-2.4.1/include -DWITH_WEBSOCKETS
  BROKER_LIBS:=$(BROKER_LIBS) -L/opt/crosstool-ng/arm-linux-gnueabi/lib/ -lz -L/opt/libwebsockets-2.4.1/lib -lwebsockets
endif

if it might help a little bit ...

@trojanc first you search libwebsockets.h in your environment. It was installed definitely by "make install" of libwebsockets. Then try the way of @Tifaifai or #245 .

I'm closing this issue because it's not a bug with mosquitto. If you are having problems getting this sorted, I'd suggest trying the mailing list.

apt install libwebsockets-dev

Was this page helpful?
0 / 5 - 0 ratings