Bazel - Getting started with C/C++

preview_player
Показать описание
Tutorial to get started with bazel and C/C++.

Keywords: bazel, C++, C, build system, getting started, tutorial.

It goes through the process of starting a new workspace from scratch, to build C/C++ source code and create an executable with the cc_binary bazel rule. It then shows how to create a library with the cc_library rule and how to use it.

0:00 Intro
0:08 BUILD file
0:45 WORKSPACE file
1:05 bazel CLI
5:14 Create library

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

Very nice insights . Looking forward for the next videos and informations .

tararaveronica
Автор

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