在VS2012中 集成protobuf 文件時, 編譯出現問題


在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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章