I tried again and it worked.
I don't know what I did differently, but whatever.

Le vendredi 29 mai 2020 16:10:23 UTC+2, Gabriel Mahoux a écrit :
>
> Hello.
> I downloaded the code source from v3.5.0 and generated the bin 
> "protoc.exe" 
> for Win 64b.
> When I execute "protoc --version", it returned "v2.5.0".
>
> In my "google/protobuf/stubs/common.h" file, the GOOGLE_PROTOBUF_VERSION 
> and GOOGLE_PROTOBUF_MIN_PROTOC_VERSION constants are set to 3005000.
>
> // The current version, represented as a single integer to make comparison
>
> // easier:  major * 10^6 + minor * 10^3 + micro
>
> #define GOOGLE_PROTOBUF_VERSION 3005000
>
>
> // A suffix string for alpha, beta or rc releases. Empty for stable 
> releases.
>
> #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
>
>
> // The minimum library version which works with the current version of the
>
> // headers.
>
> #define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3005000
>
>
> // The minimum header version which works with the current version of
>
> // the library.  This constant should only be used by protoc's C++ code
>
> // generator.
>
> static const int kMinHeaderVersionForLibrary = 3005000;
>
>
> // The minimum protoc version which works with the current version of the
>
> // headers.
>
> #define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3005000
>
> But, when I generated my class (in C++):
>  - the proto file shall have the syntax proto2 (proto3 is unrecognized)
>  - the header make a check between those and the value 2005000 !!!
>
> So, compilation displays the associated error message :
>
> #include <google/protobuf/stubs/common.h>
>
> #if GOOGLE_PROTOBUF_VERSION < 2005000
>
> #error This file was generated by a newer version of protoc which is
>
> #error incompatible with your Protocol Buffer headers.  Please update
>
> #error your headers.
>
> #endif
>
>
> #if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
>
> #error This file was generated by an older version of protoc which is
>
> #error incompatible with your Protocol Buffer headers.  Please
>
> #error regenerate this file with a newer version of protoc.
>
> #endif
>
>
> How can I get the correct version number for the version checking with the 
> correct syntax version (version 3.5.0 expected)?
>
> Thank you.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/775453fb-9f45-4d58-9bc5-346d2a4e8aad%40googlegroups.com.

Reply via email to