error C4996: Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct

使用VS13 跟  google protocbuf时出现了这个问题;真蛋疼,用别人的东西你就说不安全,用你自己的东西时你怎么不说不安全来着!

解决方案

在protoc   生成的头文件中加上

#pragma waring(disable : 4996)

不理它!

注意#pragma warning(disable : 4996)只对当前文件(包括包含了当前文件的文件)起作用,并非对整个工程。所以要在protoc生成的头文件中添加这个宏

posted @ 2014-03-31 14:24  莫压枯枯地  阅读(1653)  评论(0编辑  收藏  举报