cpp examples fail to compile on master?

10 views
Skip to first unread message

Tanuj Khattar

unread,
Sep 15, 2022, 4:07:02 PMSep 15
to Protocol Buffers
Hi Everyone, 

I want to use Protobufs for one of my bazel based C++ projects and I'm struggling to get a basic setup working. It seems the c++ examples on the master branch are also broken and fail to compile? 

See https://colab.research.google.com/drive/1dlCsApnVHW3rT7qM6jlNXCuJv3t_9IkV?usp=sharing for more details. I'm seeing the same errors on my local machine as well. 

Steps to reproduce:
```
> bazel --version 
bazel 5.3.0
> git clone https://github.com/protocolbuffers/protobuf.git && cd protobuf/examples
> bazel build :all
# Build fails. 
```

Can someone please look into the issue? 

Thanks
Tanuj

Mike Kruskal

unread,
Sep 16, 2022, 6:06:56 PMSep 16
to Tanuj Khattar, Protocol Buffers
Hey Tanuj,

This seems like a bug in our Bazel/testing setup.  I'll follow up on this separately, but if you just add the options `--cxxopt=-std=c++14 --host_cxxopt=-std=c++14` to the bazel command or to your `.bazelrc` file it should work.  e.g. this builds for me:
bazel build :all --cxxopt=-std=c++14 --host_cxxopt=-std=c++14

-Mike

--
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 protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/790999b6-14b8-4b72-914c-4eca92cf9ed5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages