Ack, I found the bug, it was just a bad include path in the makefile. SIGH.

On Friday, March 14, 2025 at 2:13:02 PM UTC-7 Adam Cozzette wrote:

> Those errors make it seem like you're somehow including a bunch of C++ 
> headers inside an extern "C" {} block, though I'm not sure why that would 
> happen. One thing to watch out for is that it's important to regenerate 
> your pb.h and pb.cc files with the new protoc if you have not already done 
> so.
>
> On Fri, Mar 14, 2025 at 1:52 PM Michelle Eshow <[email protected]> 
> wrote:
>
>> We are upgrading PB from 3.14 to 30.0, on Alma Linux 9, with g++ 11.5.0. 
>> We are using it in C++ as well as Java code.
>>
>> protoc, shared libs, and include files all show the right release -- 
>> 30.0. 
>>
>> The new installs are in /usr/local/... where the old version is in /usr/ 
>> directly
>>
>> When I try to compile our message library using gnu make, we are getting 
>> errors around use of Templates in C code and conflicting definitions of PB 
>> functions. Does this seem familiar to anyone? Below are detailed examples. 
>> We would appreciate any help at all!
>>
>> Michelle
>>
>> In file included from /usr/include/c++/11/utility:76,
>>                  from /usr/local/include/absl/base/optimization.h:37,
>>                  from /usr/local/include/absl/base/macros.h:36,
>>                  from /usr/local/include/google/protobuf/port_def.inc:35,
>>                  from /usr/local/include/google/protobuf/endian.h:20,
>>                  from /usr/include/sys/types.h:176,
>>                  from /usr/include/stdlib.h:394,
>>                  from /usr/include/c++/11/cstdlib:75,
>>                  from /usr/include/c++/11/bits/stl_algo.h:59,
>>                  from /usr/include/c++/11/string:52,
>>                  from AcLandProtobuf.pb.h:10,
>>                  from AcLandProtobuf.pb.cc:6:
>> /usr/include/c++/11/initializer_list:99:3: error: template with C linkage
>>    99 |   template<class _Tp>
>>       |   ^~~~~~~~
>>
>> /usr/local/include/google/protobuf/endian.h:161:17: error: conflicting 
>> declaration of C function ‘uint64_t 
>> google::protobuf::internal::big_endian::ToHost(uint64_t)’
>>   161 | inline uint64_t ToHost(uint64_t value) {
>>       |                 ^~~~~~
>> /usr/local/include/google/protobuf/endian.h:145:17: note: previous 
>> declaration ‘uint16_t 
>> google::protobuf::internal::big_endian::ToHost(uint16_t)’
>>   145 | inline uint16_t ToHost(uint16_t value) {
>>
>> -- 
>> 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 visit 
>> https://groups.google.com/d/msgid/protobuf/60bc47c1-649c-431d-89ee-982b4dd7c83bn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/protobuf/60bc47c1-649c-431d-89ee-982b4dd7c83bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 visit 
https://groups.google.com/d/msgid/protobuf/257cfb88-6637-4b81-bb7d-e88fc874a14en%40googlegroups.com.

Reply via email to