‘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 ❤️!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值