I am using 6.2.1 version after the build is still not successful, error:
bazel clean --expunge
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
[root@hdp01v kafkac]# bazel build //main:producer
Starting local Bazel server and connecting to it...
INFO: Analyzed target //main:producer (37 packages loaded, 162 targets configured).
INFO: Found 1 target...
ERROR: /home/kafka/software/kafkac/main/BUILD:3:10: Compiling main/producer.cc failed: (Exit 1): gcc failed: error executing command (from target //main:producer) /bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 26 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
main/producer.cc:5:21: fatal error: rdkafka.h: No such file or directory
#include "rdkafka.h"
^
compilation terminated.
Target //main:producer failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.588s, Critical Path: 0.23s
INFO: 6 processes: 6 internal.
FAILED: Build did NOT complete successfully
main/BUILD:
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
cc_binary(
name = "producer",
srcs = ["producer.cc"],
deps = [
"@librdkafka",
],
)
producer.cc:
#include <iostream>
#include <string>
#include <list>
#include <stdint.h>
#include "rdkafka.h"
#include "rdkafkacpp.h"
#include <list>
#include <cpp2sky/config.pb.h>
using namespace std;
......