protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
64.49k stars 15.36k forks source link

Missing google/protobuf/runtime_version.h #17258

Open dpservis opened 1 week ago

dpservis commented 1 week ago

What version of protobuf and what language are you using? Version: v27.2 through vcpkg using vcpkg install protobuf protobuf:x64-windows Language: C++

What operating system (Linux, Windows, ...) and version? Windows 11 What runtime / compiler are you using (e.g., python version or gcc version) MSVC 2022 v147 What did you do? Steps to reproduce the behavior:

  1. Generate code from schemas
  2. Try to use the generated code

What did you expect to see Code compiles What did you see instead? Missing google/protobuf/runtime_version.h Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs). error C1083: Cannot open include file: 'google/protobuf/runtime_version.h': No such file or directory Anything else we should know about your project / environment

zhangskz commented 3 days ago

Can you clarify how you got the version of protobuf? Looks like vcpkg only has up to 4.25.1 for protobuf? https://vcpkg.io/en/package/protobuf

poyen-wu commented 2 days ago

I am experiencing the same issue. Installed via vcpkg, version v4.25.1.

poyen-wu commented 2 days ago

Switching to a earlier version of protoc (25.1 works for me) downloaded from the release page solved the issue. The Readme indicates to install the runtime via vcpkg and download the compiler from the release page, but does not specify the version needs to match. As a user I did not expect the latest version of the compiler to not work with the runtime installed with the officially suggested method.

zhangskz commented 2 days ago

Our C++ cross version runtime policy documents that protoc/gencode version and runtime version must match: https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp

@Logofile We make some reference to this in the Binary Compatibility Warning section but could probably clarify this and link to this page in the C++ readme: https://github.com/protocolbuffers/protobuf/tree/main/src

Abdullah-AlAttar commented 10 hours ago

Same issue.....

dpservis commented 6 hours ago

Yes, this was my mistake because of version mismatch. Unfortunately vcpkg does not include the runtime and I checked out the corresponding code but at some point I updated.