I encountered an error at compile time.
bazel-out/k8-opt/bin/source/common/common/_virtual_includes/compiler_requirements_lib/common/common/compiler_requirements.h:10:2: error: #error "Your toolchain has set _GLIBCXX_USE_CXX11_ABI to a value that uses a std::string " "implementation that is not thread-safe. This may cause rare and difficult-to-debug errors " "if std::string is passed between threads in any way. If you accept this risk, you may define " "ENVOY_IGNORE_GLIBCXX_USE_CXX11_ABI_ERROR=1 in your build."
#error "Your toolchain has set _GLIBCXX_USE_CXX11_ABI to a value that uses a std::string " \
^
Target //source/exe:envoy-static failed to build
Can you tell me _GLIBCXX_USE_CXX11_ABI where this is defined?
thanks
@ggreenway thanks 锛孊ut I'm not good at CPP. so how to set up _GLIBCXX_USE_CXX11_ABI in envoy
The answer is very dependent on exactly what toolchain you're using. If you're on centos/redhat, there's no way to make it work until centos 8 is released.
For other toolchains, you can try defining _GLIBCXX_USE_CXX11_ABI=1 in your build. If that doesn't fix it, it probably means your toolchain can't work correctly. As of now, the only known issue is some flaky tests. However, that could change in the future. If you want to accept the risk, follow the directions in that error to disable to check. If you don't want to do that, you'll need to find a different toolchain that supports the c++11 standard.
@ggreenway thanks
The answer is very dependent on exactly what toolchain you're using. If you're on centos/redhat, there's no way to make it work until centos 8 is released.
Is this mean we can't build envoy in CentOS 7 ?
You can disable the warning and hope for the best, or or build your own toolchain. But centos7 does not provide any c++11 conforming toolchain, as far as my research has found.
May i know how to disable the warning? TKS
From the warning:
If you accept this risk, you may define " "ENVOY_IGNORE_GLIBCXX_USE_CXX11_ABI_ERROR=1 in your build."
Most helpful comment
From the warning: