-
-
[求助]protobuf文件编译错误,求解决方案
-
发表于:
2017-11-9 16:46
5648
-
我定义了一个结构
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)
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)