Closed joelberkeley closed 2 years ago
I believe what you are running into is some constraints on the C++ standard Bazel inserts in the compilation options. Bazel will use your system's available compilers. You can force a compiler version with export CC=/path/to/c/compiler
and export CXX=/path/to/cxx/compiler
. Additionally, to force specific options per compiler, you can use export BAZEL_CXXOPTS='-std=c++14'
or whatever version you want. I believe the feature you're looking for is only valid in C++11 or greater (don't quote me on that).
ah most helpful thanks. It worked with 14 but not 11.
I'm getting a compiler error when linking to the binary. Wondered if you'd seen it before.
I'm wrapping
libxla_extension
with a C wrapper. Originally I was using g++ and that worked fine, but I want to use Bazel instead. However, I'm now getting the compiler error at the bottom (I've shortened it because it repeats itself). If I manually editto
It compiles fine.
I've tried with Bazel 3.7.2 and 4.2.2. My gcc version is 9.3.0