我可以使用他们提供的https://github.com/open-telemetry/opentelemetry-cpp/的cmake文件进行构建,但是当我尝试使用g++ -o test test.cc -lopentelemetry_trace -lopentelemetry_exporter_otlp_grpc -lopentelemetry_resources -lopentelemetry_common
时,我得到了这样的错误:
[root@OS otlp]# g++ -o test test.cc -lopentelemetry_trace -lopentelemetry_exporter_otlp_grpc -lopentelemetry_resources -lopentelemetry_common
/usr/bin/ld: /usr/local/lib64/libopentelemetry_trace.a(tracer.cc.o): in function `opentelemetry::v1::nostd::shared_ptr<opentelemetry::v1::trace::Span>& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<opentelemetry::v1::nostd::shared_ptr<opentelemetry::v1::trace::Span>&>()':
tracer.cc:(.text._ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRN13opentelemetry2v15nostd10shared_ptrINS4_5trace4SpanEEEEET_v[_ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRN13opentelemetry2v15nostd10shared_ptrINS4_5trace4SpanEEEEET_v]+0x5): undefined reference to `absl::lts_20220623::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: /usr/local/lib64/libopentelemetry_trace.a(tracer.cc.o): in function `opentelemetry::v1::trace::SpanContext const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<opentelemetry::v1::trace::SpanContext const&>()':
tracer.cc:(.text._ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRKN13opentelemetry2v15trace11SpanContextEEET_v[_ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRKN13opentelemetry2v15trace11SpanContextEEET_v]+0x5): undefined reference to `absl::lts_20220623::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: /usr/local/lib64/libopentelemetry_trace.a(tracer.cc.o): in function `opentelemetry::v1::context::Context const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<opentelemetry::v1::context::Context const&>()':
tracer.cc:(.text._ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRKN13opentelemetry2v17context7ContextEEET_v[_ZN4absl12lts_2022062316variant_internal26TypedThrowBadVariantAccessIRKN13opentelemetry2v17context7ContextEEET_v]+0x5): undefined reference to `absl::lts_20220623::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: /usr/local/lib64/libopentelemetry_exporter_otlp_g
输出似乎告诉我absl::lts_20220623::variant_internal
不存在于libopentelemetry_trace.a
文件中,但我已经通过构建他们的项目安装了abseil
,我如何使用g++提供abseil lib?
非常感谢!
1条答案
按热度按时间rdlzhqv91#
下列文件丢失
我使用vcpkg。
安装Opentelemetry-cpp