在VS2012中 集成protobuf 文件时, 编译出现问题

来源:互联网 发布:计划提醒软件 编辑:程序博客网 时间:2024/05/21 19:45

在VS2012中 集成protobuf 文件时, 编译出现问题:


1.people.pb.cc(448): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?


解决方案:


在 people.pb.cc 上右键属性-> C/C++ ->预编译头(选择不使用预编译头)




2.xutility(2176): error C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
1>          c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2157) : see declaration of 'std::_Copy_impl'


解决方案:


属性 -> C/C++ -> 预处理器 -> 预处理器定义 (添加 _SCL_SECURE_NO_WARNINGS)
0 0
原创粉丝点击