Bazel Tutorial for C++ in 30 Minutes

preview_player
Показать описание
In this video, I will show you how to use Bazel to build your C++ programs.
I cover workspaces, repos, packages, targets, query commands, and many others. I discuss how Bazel BUILD files work and how to build and run your C++ source files.

- Link to the repo used in this video:

- A starter template for building CPP files using Bazel:
-----------------------------------------------------
Chapters:

- Introduction 00:00
- Why Bazel? 00:52
- Bazel vs Other Build Tools? 3:56
- How to use Bazel? 6:25
- C++ Build Process 7:25
- Creating a Bazel Repo 9:50
- Bazel Example 1, Single CPP file: 10:17
- The Bazel workspace file structure: 12:21
- Bazel query commands: 14:40
- Bazel generated files and symlinks 15:46
- Example 2, single library file: 16:50
- Example 30, multiple library files: 20:18
- Visibility of targets in Bazel 21:23
- Summary 26:29
- A Github template repo for Bazel C++ projects 28:34

-----------------------------------------------------
Let me know if you have any questions in the comments!
-----------------------------------------------------
See my other videos on:
-----------------------------------------------------
Keep in touch with me:

I'm the founder of BitcoinCrazyness app, the Most Advanced Cryptocurrency mobile APP for alerts, Check it out:

Рекомендации по теме
Комментарии
Автор

Concise and straight to the point. Good job with the reviews in between examples and following all examples.

kunleolutomilayo
Автор

I think, you explained a complicated topic in a simple way. Thanks.

halilibrahimakgun
Автор

your explanation skill is awesome and simple.. Thanks for this video ... If possible please upload other part of bazel videos also

RajBhalekar-lz
Автор

thanks a lot for this incredibly helpful tutorial!

王江奎
Автор

Thanks for this informative tutorial. This tutorial can be extended on the topic how to set compiler options and integration of Google test.

palasghosh
Автор

I would be grateful if you could teach us also advanced features of Bazel. Good tutorial resources for them are very scarce on the internet.

HuyNguyen-mszi
Автор

Does it compile with gcc compiler? is`nt clang default compiler for bazel C++?

itsmanikandanraju
Автор

Nice tutorial. How do you choose the compiler and the standard to compile?

RamsesAldama
Автор

Why is this not the official "get-started" ?

ChethanP-gj
Автор

I am working in one of the bazel python project need your support.
Plz let me know How to contact you

Tabbu
Автор

Thank you for the video. I have got the below error and struggling to solve. Could you please help me?

bazel run examples/example1:example1
INFO: Analyzed target //examples/example1:example1 (0 packages loaded, 0 targets configured).
ERROR: Compiling examples/example1/main.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //examples/example1:example1) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 24 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
"mount(/home/vijay/RDK/AI-ML/bazel/yt_tutorial/bazel_tutorial, /root/.cache/bazel/_bazel_root/6bcc92eabc1444bec0337c0a5b07189d/sandbox/linux-sandbox/12/_hermetic_tmp/bazel-source-roots/0, nullptr, MS_BIND | MS_REC, nullptr)": Permission denied
Target //examples/example1:example1 failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.061s, Critical Path: 0.00s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

vijayannamalaisamy