Linux&&freeswitch-1.10&&源碼安裝中遇到的幾個問題
- fatal error: libswscale/swscale.h: No such file or directory
- fatal error: libavresample/avresample.h: No such file or directory
- cc1: all warnings being treated as errors
- fatal error: lua.h: No such file or directory
- You must install libopus-dev to build mod_opus
- You must install libpq-dev to build mod_pgsql.
- You must install libks to build mod_signalwire.
- You must install signalwire-client-c to build mod_signalwire.
- You must install libsndfile-dev to build mod_sndfile.
參考資料:
https://blog.csdn.net/penker_zhao/article/details/104413193
https://www.cnblogs.com/zhuminghui/p/10980406.html
fatal error: libswscale/swscale.h: No such file or directory
問題現象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-mod_av.lo
CC libavmod_la-avformat.lo
avformat.c:42:32: fatal error: libswscale/swscale.h: No such file or directory
#include <libswscale/swscale.h>
^
compilation terminated.
解決方法:
apt-get install libswscale-dev
# 重新檢測、編譯、安裝
fatal error: libavresample/avresample.h: No such file or directory
問題現象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-avformat.lo
avformat.c:44:38: fatal error: libavresample/avresample.h: No such file or directory
#include <libavresample/avresample.h>
^
compilation terminated.
解決方法:
apt-get install libavresample-dev
# 重新檢測、編譯、安裝
cc1: all warnings being treated as errors
問題現象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-mod_av.lo
CC libavmod_la-avformat.lo
avformat.c: In function 'write_frame':
avformat.c:403:2: error: implicit declaration of function 'av_packet_rescale_ts' [-Werror=implicit-function-declaration]
av_packet_rescale_ts(pkt, *time_base, st->time_base);
^
avformat.c: In function 'alloc_picture':
avformat.c:617:2: error: implicit declaration of function 'av_frame_alloc' [-Werror=implicit-function-declaration]
picture = av_frame_alloc();
^
avformat.c:617:10: error: assignment makes pointer from integer without a cast [-Werror]
picture = av_frame_alloc();
^
avformat.c:625:2: error: implicit declaration of function 'av_frame_get_buffer' [-Werror=implicit-function-declaration]
ret = av_frame_get_buffer(picture, 32);
^
avformat.c: In function 'open_audio':
avformat.c:689:13: error: assignment makes pointer from integer without a cast [-Werror]
mst->frame = av_frame_alloc();
^
avformat.c:740:18: error: assignment makes pointer from integer without a cast [-Werror]
mst->tmp_frame = av_frame_alloc();
^
avformat.c: In function 'video_thread_run':
avformat.c:848:4: error: implicit declaration of function 'av_frame_make_writable' [-Werror=implicit-function-declaration]
ret = av_frame_make_writable(context->eh.video_st->frame);
^
avformat.c:925:4: error: implicit declaration of function 'av_packet_unref' [-Werror=implicit-function-declaration]
av_packet_unref(&pkt);
^
avformat.c: In function 'close_stream':
avformat.c:978:2: error: implicit declaration of function 'av_frame_free' [-Werror=implicit-function-declaration]
if (mst->frame) av_frame_free(&mst->frame);
^
avformat.c: In function 'show_formats':
avformat.c:1030:3: error: passing argument 1 of 'av_oformat_next' discards 'const' qualifier from pointer target type [-Werror]
while ((ofmt = av_oformat_next(ofmt))) {
^
In file included from avformat.c:37:0:
/usr/include/libavformat/avformat.h:1118:17: note: expected 'struct AVOutputFormat *' but argument is of type 'const struct AVOutputFormat *'
AVOutputFormat *av_oformat_next(AVOutputFormat *f);
^
avformat.c:1048:3: error: passing argument 1 of 'av_iformat_next' discards 'const' qualifier from pointer target type [-Werror]
while ((ifmt = av_iformat_next(ifmt))) {
^
In file included from avformat.c:37:0:
/usr/include/libavformat/avformat.h:1111:17: note: expected 'struct AVInputFormat *' but argument is of type 'const struct AVInputFormat *'
AVInputFormat *av_iformat_next(AVInputFormat *f);
^
avformat.c: In function 'open_input_file':
avformat.c:1145:5: error: implicit declaration of function 'av_rescale_q' [-Werror=implicit-function-declaration]
handle->duration = av_rescale_q(context->video_st.st->duration != AV_NOPTS_VALUE ? context->video_st.st->duration : context->fc->duration / AV_TIME_BASE * 1000,
^
avformat.c:1212:30: error: assignment makes pointer from integer without a cast [-Werror]
context->audio_st[0].frame = av_frame_alloc();
^
avformat.c:1218:31: error: assignment makes pointer from integer without a cast [-Werror]
context->audio_st[1].frame = av_frame_alloc();
^
avformat.c: In function 'file_read_thread_run':
avformat.c:1396:11: error: assignment makes pointer from integer without a cast [-Werror]
vframe = av_frame_alloc();
^
avformat.c:1445:13: error: assignment makes pointer from integer without a cast [-Werror]
vframe = av_frame_alloc();
^
avformat.c:1538:6: error: implicit declaration of function 'avresample_get_out_samples' [-Werror=implicit-function-declaration]
int out_samples = swr_get_out_samples(context->audio_st[0].resample_ctx, in_frame.nb_samples);
^
cc1: all warnings being treated as errors
make[4]: *** [libavmod_la-avformat.lo] Error 1
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
make[3]: *** [mod_av-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解決方法:
vim /usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av/Makefile
# 修改該行,刪掉“-Werror”即可
661 SWITCH_AM_CFLAGS = -I/usr/include/uuid -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include - I/usr/local/src/freeswitch-1.10-git/freeswitch/libs/libteletone/src -fPIC -ffast-math -Werror -Wno-unused-result -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DC JSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL
# 如下所示
661 SWITCH_AM_CFLAGS = -I/usr/include/uuid -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include - I/usr/local/src/freeswitch-1.10-git/freeswitch/libs/libteletone/src -fPIC -ffast-math -Wno-unused-result -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_AP I_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL
# 重新檢測、編譯、安裝
參考資料:
https://blog.csdn.net/zhou_qiao62/article/details/80449478
fatal error: lua.h: No such file or directory
問題現象:
making all mod_lua
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/languages/mod_lua'
Making all in .
make[5]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/languages/mod_lua'
CXX mod_lua_la-mod_lua.lo
mod_lua.cpp:37:17: fatal error: lua.h: No such file or directory
#include "lua.h"
^
compilation terminated.
解決方法:
apt-get install libreadline-dev
# 此處需要源碼安裝,apt-get 安裝的不知道爲什麼不能解決問題
tar -xf lua-5.3.0a.tar.gz
cd lua-5.3.0/
make linux test
make install
# 重新檢測、編譯、安裝
參考資料:
https://www.cnblogs.com/softidea/archive/2016/03/02/5236498.html
You must install libopus-dev to build mod_opus
問題現象:
making all mod_opus
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/codecs/mod_opus'
Makefile:924: *** You must install libopus-dev to build mod_opus. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/codecs/mod_opus'
make[3]: *** [mod_opus-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解決方法:
apt-get install libopus-dev
You must install libpq-dev to build mod_pgsql.
問題現象:
making all mod_pgsql
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/databases/mod_pgsql'
Makefile:922: *** You must install libpq-dev to build mod_pgsql. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/databases/mod_pgsql'
make[3]: *** [mod_pgsql-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解決方法:
apt-get install libpq-dev
You must install libks to build mod_signalwire.
問題現象:
making all mod_signalwire
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
Makefile:932: *** You must install libks to build mod_signalwire. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
make[3]: *** [mod_signalwire-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解決方法:
tar -xf cmake-3.17.2.tar.gz
cd cmake-3.17.2
./configure
make && make install
cp bin/cmake /usr/bin/
cmake --version
cd ../
git clone https://github.com/signalwire/libks.git
cd libks/
cmake .
make && make install
root@bjphp2:/usr/local/src/libks#
You must install signalwire-client-c to build mod_signalwire.
問題現象:
making all mod_signalwire
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
Makefile:927: *** You must install signalwire-client-c to build mod_signalwire. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
make[3]: *** [mod_signalwire-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解決方法:
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c/
cmake .
make && make install
You must install libsndfile-dev to build mod_sndfile.
問題現象:
making all mod_sndfile
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/formats/mod_sndfile'
Makefile:926: *** You must install libsndfile-dev to build mod_sndfile. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/formats/mod_sndfile'
make[3]: *** [mod_sndfile-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving director
解決方法:
apt-get install libsndfile1-dev libpq-dev libreadline-dev lua5.2 lua5.2-doc liblua5.2-dev libtiff5 libtiff5-dev