美文网首页C/C++
如何去除gcc编译时出现的`deprecated convers

如何去除gcc编译时出现的`deprecated convers

作者: 一木之夏 | 来源:发表于2017-09-20 13:26 被阅读10次

一种方法是在gcc编译时,将它禁掉。-Wno-write-strings

如:yangshifu@ubuntu:~/Documents/sipApp_tkj$ g++ *.cpp -shared -fpic -Wno-write-strings -o sip.so

一种方法是在C++源代码中将它禁掉,#pragma

GCC diagnostic ignored "-Wwrite-strings",只对某个文件生效

还有一种就是将const用const char*来保存就可以了

相关文章

网友评论

    本文标题:如何去除gcc编译时出现的`deprecated convers

    本文链接:https://www.haomeiwen.com/subject/tfqosxtx.html