Documentation issue: Common C Build Use Cases
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
Documentation URL: https://docs.bazel.build/versions/4.1.0/cpp-use-cases.html
The sections `Including external libraries` and `Writing and running C++ tests` are untestable in the current state.
1. The `./test/hello-test.cc` file includes `#include "lib/hello-greet.h"`, but nowhere was hello-greet mentioned. I guessed it was referring to the structure in [stage3 of the previous tutorial](https://docs.bazel.build/versions/4.1.0/tutorial/cpp.html#refine-your-bazel-build), but `hello-greet.h` in that tutorial is in `main/` and not `/lib`.
I ended up creating a directory structure like

which managed to work, but it would be nice to add this to the [github cpp-tutorial](https://github.com/bazelbuild/examples/tree/master/cpp-tutorial), maybe as a 4th stage.
2. The other problem is that the first WORKSPACE + gtest.BUILD (without the strip_prefix) in https://docs.bazel.build/versions/4.1.0/cpp-use-cases.html#including-external-libraries didn't compile for me. I get the error:

Contributor guide
Research direction
Start with the Common C++ Build Use Cases page, especially the “Including external libraries” and “Writing and running C++ tests” sections, and compare them with the github cpp-tutorial stages. Reproduce the hello-greet layout and the WORKSPACE/gtest.BUILD example, then update the documentation or tutorial so both examples compile and their required file structure is explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100