I recently updated from 3.17.3 to 3.19.x and now I cannot compile:
/usr/local/google/protobuf-3.20.x/include/google/protobuf/endian.h:150:17: error: conflicting declaration of C function ‘uint32_t google::protobuf::internal::big_endian::FromHost(uint32_t)’
Nothing has changed in my build environment:
Linux Ubuntu 22.04.1
gcc/g++ : g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
If I switch back to 3.17.3, the problem goes away.
Here is how I run protoc:
/usr/local/google/protobuf-3.20.x/bin/protoc -I=. --cpp_out=.
And here is g++ compile line:
g++ -c -m64 -x c++ -std=c++17 -Wall -I/usr/local/google/protobuf-3.20.x/include -I/usr/local/google/protobuf-3.20.x/include/google