‘struct lws_context_creation_info’ has no member named ‘ws_ping_pong_interval’

原文標題爲:How to solve Janus Gateway Build error: ‘struct lws_context_creation_info’ has no member named ‘ws_ping_pong_interval’

以下是原文給出的解決辦法:

We wrote recently a detailed guide about how to install Janus Gateway on Ubuntu 18.04 on this article. The tutorial works great, however you will face some exceptions when you try to use the latest version of the libraries that Janus needs to work.

In this case, this issue was reported on our YouTube channel a couple of days after we published the tutorial. When you install the latest version of libwebsockets and Janus 0.10.0, if you try to run make on the janus gateway source code, the following exception will be triggered:

transports/janus_websockets.c: In function ‘janus_websockets_init’:
transports/janus_websockets.c:535:11: error: ‘struct lws_context_creation_info’ has no member named ‘ws_ping_pong_interval’
    wscinfo.ws_ping_pong_interval = pingpong_trigger;
           ^
Makefile:2204: recipe for target 'transports/transports_libjanus_websockets_la-janus_websockets.lo' failed
make[2]: *** [transports/transports_libjanus_websockets_la-janus_websockets.lo] Error 1
make[2]: Leaving directory '/root/janus-installers/janus-gateway'
Makefile:3189: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/janus-installers/janus-gateway'
Makefile:1431: recipe for target 'all' failed
make: *** [all] Error 2

Copy snippet

It seems to happen only when libwebsockets has been built from the current master, so forcing a stable version like

# 1. Clone libwebsockets repo
git clone https://github.com/warmcat/libwebsockets.git
# 2. Change to its directory
cd libwebsockets
# 3. Use the stable v2.4
git checkout v2.4-stable

# 4. Follow the steps to build it 
mkdir build
cd build
cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" ..
make && sudo make install

Copy snippet

After building libwebsockets with the specified version, you should be able now to run make on the janus directory.

Happy coding ❤️!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章