这是我的资料来源:
#pragma warning(push)#pragma warning(disable: 4100) //Unreferenced formal parameter#pragma warning(disable: 4244) //Conversion,possible loss of data#pragma warning(disable: 4512) //Assignment operator Could not be generated#pragma warning(disable: 4127) //Conditional Expression is constant#pragma warning(disable: 4505) //Unreferenced local function has been removed#define CRYPtopP_ENABLE_nameSPACE_WEAK 1#include <cryptopp/md5.h>#include <cryptopp/sha.h>#pragma warning(pop)
尽管禁用:4505,我仍然收到此警告:
c:\cppdev\cryptopp561\cryptopp\misc.h(548): warning C4505: 'CryptopP::StringNarrow' : unreferenced local function has been removed
我的项目没有建立.
我该如何解决这个问题?基本上,我只想禁用第三方代码的警告;我不想编辑cryptopp本身来修复错误,如果我可以避免这样做.
解决方法 完成解析编译的源文件后,编译器只能确定未引用的函数.将相应的#pragma disable移出push / pop范围,使其在文件末尾仍然有效:#pragma warning(push)#pragma warning(disable: 4100) //Unreferenced formal parameter#pragma warning(disable: 4244) //Conversion,possible loss of data#pragma warning(disable: 4512) //Assignment operator Could not be generated#pragma warning(disable: 4127) //Conditional Expression is constant#define CRYPtopP_ENABLE_nameSPACE_WEAK 1#include <cryptopp/md5.h>#include <cryptopp/sha.h>#pragma warning(pop)#pragma warning(disable: 4505) //Unreferenced local function has been removed总结
以上是内存溢出为你收集整理的c – 如何在第三方库中预警C4505?全部内容,希望文章能够帮你解决c – 如何在第三方库中预警C4505?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)