Unable to locate absl/log/absl_check.h while compiling using g++ a protoc-generated C++ file.

380 views
Skip to first unread message

Aditya Gurajada

unread,
Aug 7, 2023, 8:36:13 PM8/7/23
to Protocol Buffers
HI, folks --
  • Platform: Linux Ubuntu 22.04.2 LTS
  • g++ : g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  • protoc: libprotoc 23.4
  • protocol buffers: v23.4
I am very stuck in trying to use protoc to generate Python bindings using --python_out argument. I have also installed protobuf-v23.4/ headers in my /usr/include/google dir.

Am experimenting with this version and have to next try how the --pyi_out feature works.

The problem I have now is that the generated C++ pb.cc file is not compiling. The error is as shown below [1].

I have installed the libabsl-dev package, but am not finding the log/ sub-dir under /usr/include/absl .

Checking around there was some post that suggested to add these flags to the cc, but that did not help either: -D ABSL_BUILD_TESTING=ON -D ABSL_BUILD_TEST_HELPERS=ON -D ABSL_USE_EXTERNAL_GOOGLETEST=ON

Github protocol buffer issue no.12201 talks about some incompatibility with s/w components involving protobuf / absl etc.

My questions are:
  1. What may be the solution for this specific compilation issue I'm facing?
  2. What is the stable version of protoc / protocol buffers one can use to not run into this missing-header-file (absl) issue?
  3. Where are the how-to instructions to download a specific working version of protocol buffer? (I had to unzip the package and manually sudo cp'over the files to /usr/include ...)
  4. Is this feature support of generating python bindings using protoc --python_out --pyi_out stable? (I've gone through the tutorials.)
Thanks, in advance,
--AdityA>

[1] Compilation error:

compiling certifier.pb.cc
g++ -I ../include -I/usr/local/opt/openssl@1.1/include/ -I ./sev-snp -g -Wall -std=c++11 -Wno-unused-variable -D X64 -Wno-deprecated-declarations -O3 -D SEV_SNP -fpic -Wno-array-bounds -o ./certifier.pb.o -c certifier.pb.cc
In file included from ../include/certifier.pb.h:24,
                 from certifier.pb.cc:4:
/usr/include/google/protobuf/io/coded_stream.h:132:10: fatal error: absl/log/absl_check.h: No such file or directory
  132 | #include "absl/log/absl_check.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Reply all
Reply to author
Forward
0 new messages