1、 右键属性,C/C++——代码生成——运行库 ,设置为 多线程调试(/MTd)
2、C/C++预处理器,添加_SCL_SECURE_NO_WARNING 和 PROTOBUF_USE_DLLS
3、C/C++——常规——附加包含目录 Z:\C++ServerProgramming\Protobuf-3.60\protobuf-cpp-3.6.0\protobuf-3.6.0\src
4、链接器——常规——附加库目录 Z:\C++ServerProgramming\Protobuf-3.60\ProtoBuildcpp3.60\Debug
4、链接器——输入 ——附加依赖项 libprotobufd.lib
5、把Z:\C++ServerProgramming\Protobuf-3.60\ProtoBuildcpp3.60\Debug下的libprotobufd.lib,复制到项目的debug目录下
#include "stdafx.h"
#include "Protocal.pb.h"
#include <iostream>
//#pragma comment(lib, "libprotobufd.lib")
//#pragma comment(lib, "libprotoc.lib")
int main()
{
GOOGLE_PROTOBUF_VERIFY_VERSION;
PBindName bindName;
bindName.set_name("wooo");
std::cout << bindName.name() << std::endl;
system("pause");
return 0;
}