Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link error in vs2012 #437

Closed
elfc2000 opened this issue May 29, 2015 · 11 comments
Closed

link error in vs2012 #437

elfc2000 opened this issue May 29, 2015 · 11 comments

Comments

@elfc2000
Copy link

4>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::ImmutableEnumFieldLiteGenerator::ImmutableEnumFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0ImmutableEnumFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xcf2b75a1@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@Z) 中被引用 4>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::ImmutableEnumOneofFieldLiteGenerator::ImmutableEnumOneofFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0ImmutableEnumOneofFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@Z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xcf2b75a1@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@z) 中被引用
4>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::RepeatedImmutableEnumFieldLiteGenerator::RepeatedImmutableEnumFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0RepeatedImmutableEnumFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::`anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xcf2b75a1@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@z) 中被引用
4>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::ParseAnyTypeUrl(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > *)" (?ParseAnyTypeUrl@internal@protobuf@google@@YA_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@Pav45@@z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Printer::PrintAny(class google::protobuf::Message const &,class google::protobuf::TextFormat::Printer::TextGenerator &)const " (?PrintAny@Printer@TextFormat@protobuf@google@@ABE_NABVMessage@34@AAVTextGenerator@1234@@z) 中被引用
4>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::GetAnyFieldDescriptors(class google::protobuf::Message const &,class google::protobuf::FieldDescriptor const * *,class google::protobuf::FieldDescriptor const * *)" (?GetAnyFieldDescriptors@internal@protobuf@google@@YA_NABVMessage@23@PAPBVFieldDescriptor@23@1@Z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Parser::ParserImpl::ConsumeField(class google::protobuf::Message *)" (?ConsumeField@ParserImpl@Parser@TextFormat@protobuf@google@@AAE_NPAVMessage@45@@z) 中被引用
4>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kAnyFullTypeName" (?kAnyFullTypeName@internal@protobuf@google@@3QBDB)
4>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kTypeGoogleApisComPrefix" (?kTypeGoogleApisComPrefix@internal@protobuf@google@@3QBDB)
4>Release\protoc.exe : fatal error LNK1120: 7 个无法解析的外部命令

@TeBoring
Copy link
Contributor

May I know which version you are using?

@elfc2000
Copy link
Author

I user protobuf master.
I had download the 3.0.0-alpha-3-windows-fix version,these no errors.

@TeBoring
Copy link
Contributor

You can try the version in 3.0.0-alpha-3 release. We fixed some errors on windows there.

@cx422803902
Copy link

i had download the Protocol Buffers v3.0.0-alpha-3 and then it also shwo some link error.can you help me?

there are the error logs:
7> mock_code_generator.cc
6>main.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
6>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::ImmutableEnumFieldLiteGenerator::ImmutableEnumFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0ImmutableEnumFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xc677eb6e@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@Z) 中被引用 6>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::ImmutableEnumOneofFieldLiteGenerator::ImmutableEnumOneofFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0ImmutableEnumOneofFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@Z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xc677eb6e@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@z) 中被引用
6>libprotoc.lib(java_field.obj) : error LNK2019: 无法解析的外部符号 "public: __thiscall google::protobuf::compiler::java::RepeatedImmutableEnumFieldLiteGenerator::RepeatedImmutableEnumFieldLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (??0RepeatedImmutableEnumFieldLiteGenerator@java@compiler@protobuf@google@@QAE@PBVFieldDescriptor@34@HHPAVContext@1234@@z),该符号在函数 "class google::protobuf::compiler::java::ImmutableFieldLiteGenerator * __cdecl google::protobuf::compiler::java::`anonymous namespace'::MakeImmutableLiteGenerator(class google::protobuf::FieldDescriptor const *,int,int,class google::protobuf::compiler::java::Context *)" (?MakeImmutableLiteGenerator@?A0xc677eb6e@java@compiler@protobuf@google@@YAPAVImmutableFieldLiteGenerator@2345@PBVFieldDescriptor@45@HHPAVContext@2345@@z) 中被引用
6>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::ParseAnyTypeUrl(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > *)" (?ParseAnyTypeUrl@internal@protobuf@google@@YA_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@Pav45@@z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Printer::PrintAny(class google::protobuf::Message const &,class google::protobuf::TextFormat::Printer::TextGenerator &)const " (?PrintAny@Printer@TextFormat@protobuf@google@@ABE_NABVMessage@34@AAVTextGenerator@1234@@z) 中被引用
6>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::GetAnyFieldDescriptors(class google::protobuf::Message const &,class google::protobuf::FieldDescriptor const * *,class google::protobuf::FieldDescriptor const * *)" (?GetAnyFieldDescriptors@internal@protobuf@google@@YA_NABVMessage@23@PAPBVFieldDescriptor@23@1@Z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Parser::ParserImpl::ConsumeField(class google::protobuf::Message *)" (?ConsumeField@ParserImpl@Parser@TextFormat@protobuf@google@@AAE_NPAVMessage@45@@z) 中被引用
6>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kAnyFullTypeName" (?kAnyFullTypeName@internal@protobuf@google@@3QBDB)
6>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kTypeGoogleApisComPrefix" (?kTypeGoogleApisComPrefix@internal@protobuf@google@@3QBDB)
6>Debug\protoc.exe : fatal error LNK1120: 7 个无法解析的外部命令
8>------ 已启动全部重新生成: 项目: lite-test, 配置: Debug Win32 ------
8> Generating unittest_lite.pb.{h,cc}...
8> 'Debug\protoc' 不是内部或外部命令,也不是可运行的程序
8> 或批处理文件。
8> Generating unittest_import_lite.pb.{h,cc}...
8> 'Debug\protoc' 不是内部或外部命令,也不是可运行的程序
8> 或批处理文件。
8> Generating unittest_import_public_lite.pb.{h,cc}...
8> 'Debug\protoc' 不是内部或外部命令,也不是可运行的程序
8> 或批处理文件。
8> Generating map_lite_unittest.pb.{h,cc}...
8> 'Debug\protoc' 不是内部或外部命令,也不是可运行的程序
8> 或批处理文件。
8>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: “cmd.exe”已退出,代码为 9009。
7> test_plugin.cc
7> 正在生成代码...
7>test_plugin.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
7>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::ParseAnyTypeUrl(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > *)" (?ParseAnyTypeUrl@internal@protobuf@google@@YA_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@Pav45@@z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Printer::PrintAny(class google::protobuf::Message const &,class google::protobuf::TextFormat::Printer::TextGenerator &)const " (?PrintAny@Printer@TextFormat@protobuf@google@@ABE_NABVMessage@34@AAVTextGenerator@1234@@z) 中被引用
7>libprotobuf.lib(text_format.obj) : error LNK2019: 无法解析的外部符号 "bool __cdecl google::protobuf::internal::GetAnyFieldDescriptors(class google::protobuf::Message const &,class google::protobuf::FieldDescriptor const * *,class google::protobuf::FieldDescriptor const * *)" (?GetAnyFieldDescriptors@internal@protobuf@google@@YA_NABVMessage@23@PAPBVFieldDescriptor@23@1@Z),该符号在函数 "private: bool __thiscall google::protobuf::TextFormat::Parser::ParserImpl::ConsumeField(class google::protobuf::Message *)" (?ConsumeField@ParserImpl@Parser@TextFormat@protobuf@google@@AAE_NPAVMessage@45@@z) 中被引用
7>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kAnyFullTypeName" (?kAnyFullTypeName@internal@protobuf@google@@3QBDB)
7>libprotobuf.lib(text_format.obj) : error LNK2001: 无法解析的外部符号 "char const * const google::protobuf::internal::kTypeGoogleApisComPrefix" (?kTypeGoogleApisComPrefix@internal@protobuf@google@@3QBDB)
7>Debug\test_plugin.exe : fatal error LNK1120: 4 个无法解析的外部命令

@TeBoring
Copy link
Contributor

TeBoring commented Jun 1, 2015

May I know which OS and visual studio you are using?

@cx422803902
Copy link

I'm using window 8 and visula studio 2012.Is it any problem?

@larsonmpdx
Copy link

I get the same link errors on vs2013 with v3.0.0-alpha-3. couldn't find these functions:

ParseAnyTypeUrl GetAnyFieldDescriptors kAnyFullTypeName kTypeGoogleApisComPrefix

@larsonmpdx
Copy link

this was because the new file any.cc wasn't being compiled - I think it was fixed by commit 2e66304, but I didn't get a new copy because I'm getting the code as a git submodule and didn't see I had changes to the vs project files

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jun 5, 2015

Closing this issue assuming it's actually already fixed in the release. For those who have this issue, please try the version we put up in the releases page: https://github.com/google/protobuf/releases

@xfxyjwf xfxyjwf closed this as completed Jun 5, 2015
@cx422803902
Copy link

I had said that I am using the last vesion.so ?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jun 17, 2015

Can you be more specific on what version you are using? I.e., which commit? We could not reproduce the problem you are reporting with 3.0.0-alpha-3

bithium pushed a commit to bithium/protobuf that referenced this issue Sep 4, 2023
…packed-enums

Fix big-endian encodings for fixed packed arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@TeBoring @elfc2000 @xfxyjwf @cx422803902 @larsonmpdx and others