Error compiling Google Protocol Buffer Output (C++)

Viewed 39

Update #2: Issue closed, but curious about all the error messages.

I got it to compile after including #define PROTOBUF_USE_DLLS. After the build, the Error List still shows 398 errors and the output window lists a lot of warnings, but it still compiled. Why is that?

I downloaded the Google Protocol Buffer source and was able to compile it without issues on Visual Studio 2015. However, the Google Protocol Buffer compiler generates C++ output that has a lot of compile errors. Is the compiler output below compatible with Visual Studio 2015 (C++14, I think)? Looks like a later standard of C++. If it's not, does anyone familiar with Google Protocol Buffer for C++ know how to make it output VS2015-friendly output? I downloaded from here: https://github.com/protocolbuffers/protobuf/releases

enter image description here

Update: Here's the compiler output:

1> Creating library C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.lib and object C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.exp 1>msgcore.pb.obj : error LNK2001: unresolved external symbol "class google::protobuf::internal::ExplicitlyConstructed<class std::basic_string<char,struct std::char_traits,class std::allocator >,8> google::protobuf::internal::fixed_address_empty_string" (?fixed_address_empty_string@internal@protobuf@google@@3V?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$07@123@A) 1>C:\DEV\Visual Studio 2015\Projects\DEV\VSSolution\x64\Debug\Monitor.dll : fatal error LNK1120: 1 unresolved externals

Strange, I see 510 compiler errors under the Error List tab of Visual Studio, but under the compiler output, I only see the one unresolved externals error above. That's a linking error implying that it already compiled? How come I don't see the compiler errors high-lighted in the screenshot below and on the Error List in the Output window?

1 Answers

The errors turned out to be Visual Studio Intellisense errors and not "actual" compile errors. For the one linking error, the issue was resolved by adding #define PROTOBUF_USE_DLLS to the protoc-generated C++ output.

Related