webrtc linux编译 werror=return-type等问题处理

本文介绍了在Webrtc编译过程中如何手动调整编译参数,包括通过修改toolchain.ninja文件添加特定的C/C++编译选项,如-Wno-error=overloaded-virtual和-D_GLIBCXX_USE_CXX11_ABI=0,以解决编译过程中的警告和错误。

webrtc编译时,控制编译器参数的地方暂时没找到,但是在最终的编译目录,有toolchain.ninja,可以通过手动修改这个文件控制编译参数:

比如在out/debug/toolchain.ninja文件,

内部会有c,C++编译参数的规则,可以自己手动添加:-Wno-error=overloaded-virtual

按道理应该也可以也可以再webrtc.gni中修改cflags_cc来添加自己的编译参数,但是当时可能我添加错了,我加了-Wno-error,没有指定-Wno-error=xxxxx所以一直不正确;

 

还有注意加上:-D_GLIBCXX_USE_CXX11_ABI=0,否则也有地方会报C++11 string找不到的什么错误

逐行解释打印,说明加载失败原因 buildmbedtls-opus.sh buildmbedtls-pcmu.sh buildopenssl-opus.sh buildopenssl-pcmu.sh t1@t1:~/Desktop/EV200/webrtc-stream-anyka_uclibc-linux/example$ ./buildmbedtls-opus.sh ----------------------------------------------------------------- ----------------------------------------------------------------- main.c: In function ‘PlayBack_OpenFile’: main.c:1836:40: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 128 [-Wformat-truncation=] snprintf(szfile,sizeof(szfile),"%s/%s",p->szpath,pfilename); ^~ In file included from /usr/include/stdio.h:862:0, from main.c:3: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output 2 or more bytes (assuming 257) into a destination of size 128 return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c: In function ‘remoteplay_messageFun’: main.c:1836:40: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 128 [-Wformat-truncation=] snprintf(szfile,sizeof(szfile),"%s/%s",p->szpath,pfilename); ^~ In file included from /usr/include/stdio.h:862:0, from main.c:3: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output 2 or more bytes (assuming 257) into a destination of size 128 return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/bin/ld: /home/t1/Desktop/EV200/webrtc-stream-anyka_uclibc-linux/example/../lib/opus/mbedtls/libwebrtc-stream.a(webrtc.o): Relocations in generic ELF (EM: 40) /home/t1/Desktop/EV200/webrtc-stream-anyka_uclibc-linux/example/../lib/opus/mbedtls/libwebrtc-stream.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status
最新发布
06-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值