首页
社区
课程
招聘
[求助]protobuf文件编译错误,求解决方案
2017-11-9 16:46 5252

[求助]protobuf文件编译错误,求解决方案

2017-11-9 16:46
5252
我定义了一个结构
package tutorial;  
  
message Person {  
  required string name = 1;  
  required int32 age = 2;  
  optional string email = 3;    
}

把person.pb.h、person.pb.cc放到我的VS2008的代码中,编译 person.pb.cc 是OK的,但Link过程出现如下错误,该怎么解决:

1>person.pb.obj : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::internal::AssignDescriptors(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct google::protobuf::internal::MigrationSchema const *,class google::protobuf::Message const * const *,unsigned int const *,class google::protobuf::MessageFactory *,struct google::protobuf::Metadata *,class google::protobuf::EnumDescriptor const * *,class google::protobuf::ServiceDescriptor const * *)" (?AssignDescriptors@internal@protobuf@google@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBUMigrationSchema@123@PBQBVMessage@23@PBIPAVMessageFactory@23@PAUMetadata@23@PAPBVEnumDescriptor@23@PAPBVServiceDescriptor@23@@Z) referenced in function "void __cdecl tutorial::protobuf_person_2eproto::`anonymous namespace'::protobuf_AssignDescriptors(void)" (?protobuf_AssignDescriptors@?A0xa87d9ff2@protobuf_person_2eproto@tutorial@@YAXXZ)
1>person.pb.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall google::protobuf::internal::FunctionClosure0::~FunctionClosure0(void)" (??1FunctionClosure0@internal@protobuf@google@@UAE@XZ) referenced in function "void __cdecl google::protobuf::GoogleOnceInit(int *,void (__cdecl*)(void))" (?GoogleOnceInit@protobuf@google@@YAXPAHP6AXXZ@Z)
1>person.pb.obj : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::GoogleOnceInitImpl(int *,class google::protobuf::Closure *)" (?GoogleOnceInitImpl@protobuf@google@@YAXPAHPAVClosure@12@@Z) referenced in function "void __cdecl google::protobuf::GoogleOnceInit(int *,void (__cdecl*)(void))" (?GoogleOnceInit@protobuf@google@@YAXPAHP6AXXZ@Z)
1>person.pb.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall google::protobuf::Closure::~Closure(void)" (??1Closure@protobuf@google@@UAE@XZ) referenced in function "public: virtual void * __thiscall google::protobuf::Closure::`scalar deleting destructor'(unsigned int)" (??_GClosure@protobuf@google@@UAEPAXI@Z)

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
打赏
分享
最新回复 (3)
雪    币: 91
活跃值: (25)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
DZYLin 1 2017-11-11 11:11
2
0
是不是protobuf的.lib文件没加进去
雪    币: 1085
活跃值: (114)
能力值: ( LV8,RANK:120 )
在线值:
发帖
回帖
粉丝
gaollxu 2 2018-2-2 11:25
3
0
跟编译选项应该有关,结贴。
雪    币: 2
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
wx_kx37888 2018-6-6 19:14
4
0
具体哪个选项??
游客
登录 | 注册 方可回帖
返回