open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
890 stars 427 forks source link

Undefined reference error while building simple example #2188

Open TheOxFromOutOfTheBox opened 1 year ago

TheOxFromOutOfTheBox commented 1 year ago

Describe your environment Describe any aspect of your environment relevant to the problem, including your platform, build system, version numbers of installed dependencies, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main branch. OS - SUSE Linux Enterprise Server 15 Installed opentelemetry-cpp[otlp-grpc] through vcpkg.

Steps to reproduce Describe exactly how to reproduce the error. Include a code sample if applicable. I ran a slightly modified version of the simple example given in the repository.

g++ trial.cpp -std=c++14 -I vcpkg/packages/opentelemetry-cpp_x64-linux/include/ && ./a.out
#include "opentelemetry/exporters/ostream/span_exporter_factory.h"
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
#include "opentelemetry/trace/provider.h"

namespace trace_api      = opentelemetry::trace;
namespace trace_sdk      = opentelemetry::sdk::trace;
namespace trace_exporter = opentelemetry::exporter::trace;

namespace
{
void InitTracer()
{
  auto exporter  = trace_exporter::OStreamSpanExporterFactory::Create();
  auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter));
  std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
      trace_sdk::TracerProviderFactory::Create(std::move(processor));

  // Set the global trace provider
  trace_api::Provider::SetTracerProvider(provider);
}

void CleanupTracer()
{
  std::shared_ptr<opentelemetry::trace::TracerProvider> none;
  trace_api::Provider::SetTracerProvider(none);
}
}  // namespace

int main()
{
  // Removing this line will leave the default noop TracerProvider in place.
  InitTracer();

    auto provider = trace_api::Provider::GetTracerProvider();
    auto tracer = provider->GetTracer("foo_library");

  //create a span
    auto span = tracer->StartSpan("first-span");
    auto scope = tracer->WithActiveSpan(span);
    //inner ops
    std::this_thread::sleep_for(std::chrono::milliseconds(100));
    span->End();

    std::cout<<"Heloworld!"<<std::endl;
    CleanupTracer();
    return 0;
} 

What is the expected behavior? What did you expect to see? The program should compile without errors and execute.

What is the actual behavior? What did you see instead? The program passes syntax and lexical analysis , and fails during machine code generation, with the error

 /tmp/ccdjnFU7.o: In function `(anonymous namespace)::InitTracer()':
trial.cpp:(.text+0x1c5): undefined reference to `opentelemetry::v1::exporter::trace::OStreamSpanExporterFactory::Create()'
trial.cpp:(.text+0x1e3): undefined reference to `opentelemetry::v1::sdk::trace::SimpleSpanProcessorFactory::Create(std::unique_ptr<opentelemetry::v1::sdk::trace::SpanExporter, std::default_delete<opentelemetry::v1::sdk::trace::SpanExporter> >&&)'
trial.cpp:(.text+0x214): undefined reference to `opentelemetry::v1::sdk::trace::TracerProviderFactory::Create(std::unique_ptr<opentelemetry::v1::sdk::trace::SpanProcessor, std::default_delete<opentelemetry::v1::sdk::trace::SpanProcessor> >)'
collect2: error: ld returned 1 exit status 

Additional context Add any other context about the problem here.

owent commented 1 year ago

You may also need to link all components you use of otel-cpp. Alternatively, you can use cmake to automatically link them if you are using vcpkg.

TheOxFromOutOfTheBox commented 1 year ago

Hi owent, I tried to make a CMakeLists.txt

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

target_link_libraries(opentelemetry_exporter_ostream_span ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)

add_executable(example_simple main.cc)
target_link_libraries(example_simple ${CMAKE_THREAD_LIBS_INIT} opentelemetry_trace)

However I get the error while doing cmake

CMake Error at CMakeLists.txt:5 (target_link_libraries):
  Cannot specify link libraries for target
  "opentelemetry_exporter_ostream_span" which is not built by this project.

This is presumably because it cant find the libraries,due to it being in different folders. But I'm at a loss as to how to provide reference to the folder image This is my folder structure, and my otel is inside vcpkg/packages.

Thanks for the quick reply.

owent commented 1 year ago

In cmake, you can use find_package(opentelemetry-cpp) to find otel-cpp and use target_link_libraries(example_simple opentelemetry-cpp::ostream_span_exporter) to link it.

TheOxFromOutOfTheBox commented 1 year ago

Hey, I'm trying to build a cmake file with the help of https://github.com/open-telemetry/opentelemetry-cpp/issues/1359 but my build keeps failing saying it cant find absl while i do have abseil installed.

my cmakelists.txt

cmake_minimum_required(VERSION 3.17)
project(otel-test)

set(CMAKE_FIND_DEBUG_MODE 1)
set(CMAKE_PREFIX_PATH ../vcpkg/packages/)
find_package(opentelemetry-cpp REQUIRED)
find_package(Protobuf REQUIRED)
set(OPENSSL_ROOT_DIR /home/kmh/vcpkg/packages/openssl_x64-linux/)
find_package(CURL REQUIRED)
find_package(gRPC REQUIRED)
find_package(abseil REQUIRED)

message(STATUS "otel c++ include dirs: ${OPENTELEMETRY_CPP_INCLUDE_DIRS}")
message(STATUS "otel c++ libs: ${OPENTELEMETRY_CPP_LIBRARIES}")

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

target_link_libraries(opentelemetry::ostream_span_exporter ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)

add_executable(example_simple main.cc)
target_link_libraries(example_simple ${CMAKE_THREAD_LIBS_INIT} opentelemetry::opentelemetry_trace)

my error:

CMake Debug Log at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  find_package considered the following paths for absl.cmake

    /usr/share/cmake/Modules/Findabsl.cmake

  The file was not found.

    /usr/local/lib64/cmake/absl/abslConfig.cmake

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake:87 (find_dependency)
  CMakeLists.txt:6 (find_package)

CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  Found package configuration file:

    /usr/local/lib64/cmake/absl/abslConfig.cmake

  but it set absl_FOUND to FALSE so package "absl" is considered to be NOT
  FOUND.  Reason given by package:

  The following imported targets are referenced, but are missing:
  protobuf::gmock

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake:87 (find_dependency)
  CMakeLists.txt:6 (find_package)

CMake Debug Log at CMakeLists.txt:6 (find_package):
  find_package considered the following paths for opentelemetry-cpp.cmake

    /usr/share/cmake/Modules/Findopentelemetry-cpp.cmake

  The file was not found.

    /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cppConfig.cmake
    /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake

-- Configuring incomplete, errors occurred!
See also "/home/kmh/test-otel/CMakeFiles/CMakeOutput.log".
See also "/home/kmh/test-otel/CMakeFiles/CMakeError.log".
TheOxFromOutOfTheBox commented 1 year ago

So, on further research I realized I had to remove the absl installed before in usr/local in order to use the one vcpkg installed so I added it to the CMAKE_IGNORE_PATH variable.

My updated CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
project(otel-test)

set(CMAKE_PREFIX_PATH "../vcpkg/packages/;/home/kmh/vcpkg/packages/abseil_x64-linux/share;/home/kmh/vcpkg/packages/openssl_x64-linux/")
message(STATUS "root dir - ${OPENSSL_ROOT_DIR}")
set(CMAKE_IGNORE_PATH "/usr/local/lib64/cmake/absl/")
message(STATUS "${CMAKE_PREFIX_PATH}")
find_package(opentelemetry-cpp CONFIG REQUIRED)
find_package(Protobuf REQUIRED)
set(OPENSSL_ROOT_DIR /home/kmh/vcpkg/packages/openssl_x64-linux/)
find_package(CURL REQUIRED)
find_package(gRPC REQUIRED)
find_package(abseil REQUIRED)

message(STATUS "otel c++ include dirs: ${OPENTELEMETRY_CPP_INCLUDE_DIRS}")
message(STATUS "otel c++ libs: ${OPENTELEMETRY_CPP_LIBRARIES}")

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

target_link_libraries(opentelemetry::ostream_span_exporter ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)

add_executable(example_simple test.cpp)
target_link_libraries(example_simple ${CMAKE_THREAD_LIBS_INIT} opentelemetry::opentelemetry_trace)

That takes me past the absl error however I now face an OpenSSL include error.

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.1.1d", but
  required is at least "3" (found /usr/lib64/libcrypto.so)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:443 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindOpenSSL.cmake:450 (find_package_handle_standard_args)
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /home/kmh/vcpkg/packages/curl_x64-linux/share/curl/CURLConfig.cmake:52 (find_dependency)
  /usr/share/cmake/Modules/FindCURL.cmake:58 (find_package)
  CMakeLists.txt:11 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/kmh/test-otel/CMakeFiles/CMakeOutput.log".
See also "/home/kmh/test-otel/CMakeFiles/CMakeError.log".

Changing the OPENSSL_ROOT_DIR variable however doesn't have any effect, as you can see in line 10 of my CMakeLists.txt

TheOxFromOutOfTheBox commented 1 year ago

I was also checking out another way to link all libraries via g++ itself, and I ran into this

g++ -I/home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/include/ test.cpp -o program -L/home/kmh/vcpkg/installed/x64-linux/lib/ $(ls /home/kmh/vcpkg/installed/x64-linux/lib/ | grep '\.a$' | sed 's/lib/-l/' | sed 's/\.a//')

Contents of /home/kmh/vcpkg/installed/x64-linux/lib/

total 71M
drwxr-xr-x 1 root root 6.3K Jun  9 17:00 .
drwxr-xr-x 1 root root   56 Jun  9 16:30 ..
-rw-r--r-- 1 root root 4.1K Jun  9 16:25 libabsl_bad_any_cast_impl.a
-rw-r--r-- 1 root root 4.3K Jun  9 16:25 libabsl_bad_optional_access.a
-rw-r--r-- 1 root root 4.5K Jun  9 16:25 libabsl_bad_variant_access.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_base.a
-rw-r--r-- 1 root root 4.3K Jun  9 16:25 libabsl_city.a
-rw-r--r-- 1 root root  29K Jun  9 16:25 libabsl_civil_time.a
-rw-r--r-- 1 root root 118K Jun  9 16:25 libabsl_cord.a
-rw-r--r-- 1 root root 121K Jun  9 16:25 libabsl_cord_internal.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_cordz_functions.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_cordz_handle.a
-rw-r--r-- 1 root root  20K Jun  9 16:25 libabsl_cordz_info.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_cordz_sample_token.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_crc32c.a
-rw-r--r-- 1 root root  23K Jun  9 16:25 libabsl_crc_cord_state.a
-rw-r--r-- 1 root root 5.4K Jun  9 16:25 libabsl_crc_cpu_detect.a
-rw-r--r-- 1 root root  20K Jun  9 16:25 libabsl_crc_internal.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_debugging_internal.a
-rw-r--r-- 1 root root  45K Jun  9 16:25 libabsl_demangle_internal.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_die_if_null.a
-rw-r--r-- 1 root root 5.7K Jun  9 16:25 libabsl_examine_stack.a
-rw-r--r-- 1 root root 3.1K Jun  9 16:25 libabsl_exponential_biased.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_failure_signal_handler.a
-rw-r--r-- 1 root root  932 Jun  9 16:25 libabsl_flags.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_flags_commandlineflag.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_flags_commandlineflag_internal.a
-rw-r--r-- 1 root root  23K Jun  9 16:25 libabsl_flags_config.a
-rw-r--r-- 1 root root  40K Jun  9 16:25 libabsl_flags_internal.a
-rw-r--r-- 1 root root  37K Jun  9 16:25 libabsl_flags_marshalling.a
-rw-r--r-- 1 root root  91K Jun  9 16:25 libabsl_flags_parse.a
-rw-r--r-- 1 root root 3.2K Jun  9 16:25 libabsl_flags_private_handle_accessor.a
-rw-r--r-- 1 root root 6.5K Jun  9 16:25 libabsl_flags_program_name.a
-rw-r--r-- 1 root root  53K Jun  9 16:25 libabsl_flags_reflection.a
-rw-r--r-- 1 root root 5.1K Jun  9 16:25 libabsl_flags_usage.a
-rw-r--r-- 1 root root  65K Jun  9 16:25 libabsl_flags_usage_internal.a
-rw-r--r-- 1 root root  46K Jun  9 16:25 libabsl_graphcycles_internal.a
-rw-r--r-- 1 root root 3.7K Jun  9 16:25 libabsl_hash.a
-rw-r--r-- 1 root root  15K Jun  9 16:25 libabsl_hashtablez_sampler.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_int128.a
-rw-r--r-- 1 root root 2.6K Jun  9 16:25 libabsl_leak_check.a
-rw-r--r-- 1 root root 1.3K Jun  9 16:25 libabsl_log_entry.a
-rw-r--r-- 1 root root  21K Jun  9 16:25 libabsl_log_flags.a
-rw-r--r-- 1 root root 9.0K Jun  9 16:25 libabsl_log_globals.a
-rw-r--r-- 1 root root 1.7K Jun  9 16:25 libabsl_log_initialize.a
-rw-r--r-- 1 root root  32K Jun  9 16:25 libabsl_log_internal_check_op.a
-rw-r--r-- 1 root root 2.7K Jun  9 16:25 libabsl_log_internal_conditions.a
-rw-r--r-- 1 root root 6.4K Jun  9 16:25 libabsl_log_internal_format.a
-rw-r--r-- 1 root root 5.6K Jun  9 16:25 libabsl_log_internal_globals.a
-rw-r--r-- 1 root root  18K Jun  9 16:25 libabsl_log_internal_log_sink_set.a
-rw-r--r-- 1 root root  47K Jun  9 16:25 libabsl_log_internal_message.a
-rw-r--r-- 1 root root 1.4K Jun  9 16:25 libabsl_log_internal_nullguard.a
-rw-r--r-- 1 root root 5.9K Jun  9 16:25 libabsl_log_internal_proto.a
-rw-r--r-- 1 root root 3.3K Jun  9 16:25 libabsl_log_severity.a
-rw-r--r-- 1 root root 3.0K Jun  9 16:25 libabsl_log_sink.a
-rw-r--r-- 1 root root 1.9K Jun  9 16:25 libabsl_low_level_hash.a
-rw-r--r-- 1 root root  22K Jun  9 16:25 libabsl_malloc_internal.a
-rw-r--r-- 1 root root 4.5K Jun  9 16:25 libabsl_periodic_sampler.a
-rw-r--r-- 1 root root  13K Jun  9 16:25 libabsl_random_distributions.a
-rw-r--r-- 1 root root  31K Jun  9 16:25 libabsl_random_internal_distribution_test_util.a
-rw-r--r-- 1 root root 5.7K Jun  9 16:25 libabsl_random_internal_platform.a
-rw-r--r-- 1 root root  25K Jun  9 16:25 libabsl_random_internal_pool_urbg.a
-rw-r--r-- 1 root root 3.4K Jun  9 16:25 libabsl_random_internal_randen.a
-rw-r--r-- 1 root root 1.5K Jun  9 16:25 libabsl_random_internal_randen_hwaes.a
-rw-r--r-- 1 root root 3.1K Jun  9 16:25 libabsl_random_internal_randen_hwaes_impl.a
-rw-r--r-- 1 root root 8.3K Jun  9 16:25 libabsl_random_internal_randen_slow.a
-rw-r--r-- 1 root root 4.2K Jun  9 16:25 libabsl_random_internal_seed_material.a
-rw-r--r-- 1 root root 5.2K Jun  9 16:25 libabsl_random_seed_gen_exception.a
-rw-r--r-- 1 root root 3.0K Jun  9 16:25 libabsl_random_seed_sequences.a
-rw-r--r-- 1 root root 6.2K Jun  9 16:25 libabsl_raw_hash_set.a
-rw-r--r-- 1 root root 7.1K Jun  9 16:25 libabsl_raw_logging_internal.a
-rw-r--r-- 1 root root 4.1K Jun  9 16:25 libabsl_scoped_set_env.a
-rw-r--r-- 1 root root 2.9K Jun  9 16:25 libabsl_spinlock_wait.a
-rw-r--r-- 1 root root 5.8K Jun  9 16:25 libabsl_stacktrace.a
-rw-r--r-- 1 root root  43K Jun  9 16:25 libabsl_status.a
-rw-r--r-- 1 root root  15K Jun  9 16:25 libabsl_statusor.a
-rw-r--r-- 1 root root 5.0K Jun  9 16:25 libabsl_strerror.a
-rw-r--r-- 1 root root 180K Jun  9 16:25 libabsl_str_format_internal.a
-rw-r--r-- 1 root root 198K Jun  9 16:25 libabsl_strings.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_strings_internal.a
-rw-r--r-- 1 root root  31K Jun  9 16:25 libabsl_symbolize.a
-rw-r--r-- 1 root root  80K Jun  9 16:25 libabsl_synchronization.a
-rw-r--r-- 1 root root  17K Jun  9 16:25 libabsl_throw_delegate.a
-rw-r--r-- 1 root root 109K Jun  9 16:25 libabsl_time.a
-rw-r--r-- 1 root root 196K Jun  9 16:25 libabsl_time_zone.a
-rw-r--r-- 1 root root  11K Jun  9 16:57 libaddress_sorting.a
-rw-r--r-- 1 root root 192K Jun  9 16:26 libcares.a
-rw-r--r-- 1 root root  11M Jun  9 16:30 libcrypto.a
-rw-r--r-- 1 root root 1.3M Jun  9 16:30 libcurl.a
-rw-r--r-- 1 root root  25K Jun  9 16:35 libdescriptor_upb_proto.a
-rw-r--r-- 1 root root 130K Jun  9 16:57 libgpr.a
-rw-r--r-- 1 root root 2.3M Jun  9 16:57 libgrpc++.a
-rw-r--r-- 1 root root  19M Jun  9 16:57 libgrpc.a
-rw-r--r-- 1 root root  39K Jun  9 16:57 libgrpc++_alts.a
-rw-r--r-- 1 root root 1020 Jun  9 16:57 libgrpc++_error_details.a
-rw-r--r-- 1 root root 887K Jun  9 16:57 libgrpc_plugin_support.a
-rw-r--r-- 1 root root 986K Jun  9 16:57 libgrpcpp_channelz.a
-rw-r--r-- 1 root root 682K Jun  9 16:57 libgrpc++_reflection.a
-rw-r--r-- 1 root root 1.4M Jun  9 16:57 libgrpc++_unsecure.a
-rw-r--r-- 1 root root  11M Jun  9 16:57 libgrpc_unsecure.a
-rw-r--r-- 1 root root  69K Jun  9 17:00 libopentelemetry_common.a
-rw-r--r-- 1 root root 168K Jun  9 17:00 libopentelemetry_exporter_in_memory.a
-rw-r--r-- 1 root root  45K Jun  9 17:00 libopentelemetry_exporter_ostream_logs.a
-rw-r--r-- 1 root root 113K Jun  9 17:00 libopentelemetry_exporter_ostream_metrics.a
-rw-r--r-- 1 root root 183K Jun  9 17:00 libopentelemetry_exporter_ostream_span.a
-rw-r--r-- 1 root root  51K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc.a
-rw-r--r-- 1 root root  57K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_client.a
-rw-r--r-- 1 root root  51K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_log.a
-rw-r--r-- 1 root root  52K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_metrics.a
-rw-r--r-- 1 root root 542K Jun  9 17:00 libopentelemetry_logs.a
-rw-r--r-- 1 root root 1.8M Jun  9 17:00 libopentelemetry_metrics.a
-rw-r--r-- 1 root root 159K Jun  9 17:00 libopentelemetry_otlp_recordable.a
-rw-r--r-- 1 root root 807K Jun  9 17:00 libopentelemetry_proto.a
-rw-r--r-- 1 root root 836K Jun  9 17:00 libopentelemetry_proto_grpc.a
-rw-r--r-- 1 root root 145K Jun  9 17:00 libopentelemetry_resources.a
-rw-r--r-- 1 root root 638K Jun  9 17:00 libopentelemetry_trace.a
-rw-r--r-- 1 root root 3.2K Jun  9 17:00 libopentelemetry_version.a
-rw-r--r-- 1 root root 5.6M Jun  9 16:34 libprotobuf.a
-rw-r--r-- 1 root root 1.3M Jun  9 16:34 libprotobuf-lite.a
-rw-r--r-- 1 root root 6.3M Jun  9 16:34 libprotoc.a
-rw-r--r-- 1 root root 1.2M Jun  9 16:35 libre2.a
-rw-r--r-- 1 root root 1.2M Jun  9 16:30 libssl.a
-rw-r--r-- 1 root root  63K Jun  9 16:35 libupb.a
-rw-r--r-- 1 root root 7.8K Jun  9 16:35 libupb_collections.a
-rw-r--r-- 1 root root 2.4K Jun  9 16:35 libupb_extension_registry.a
-rw-r--r-- 1 root root  940 Jun  9 16:35 libupb_fastdecode.a
-rw-r--r-- 1 root root 100K Jun  9 16:35 libupb_json.a
-rw-r--r-- 1 root root  17K Jun  9 16:35 libupb_mini_table.a
-rw-r--r-- 1 root root  86K Jun  9 16:35 libupb_reflection.a
-rw-r--r-- 1 root root  12K Jun  9 16:35 libupb_textformat.a
-rw-r--r-- 1 root root 3.3K Jun  9 16:35 libupb_utf8_range.a
-rw-r--r-- 1 root root 159K Jun  9 16:30 libz.a
drwxr-xr-x 1 root root 8.4K Jun  9 16:57 pkgconfig

Error :

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::printAttributes(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, absl::lts_20230125::variant<bool, int, unsigned int, long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<bool, std::allocator<bool> >, std::vector<int, std::allocator<int> >, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >, std::vector<unsigned char, std::allocator<unsigned char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, absl::lts_20230125::variant<bool, int, unsigned int, long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<bool, std::allocator<bool> >, std::vector<int, std::allocator<int> >, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >, std::vector<unsigned char, std::allocator<unsigned char> > > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
span_exporter.cc:(.text+0x1055): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::Export(opentelemetry::v1::nostd::span<std::unique_ptr<opentelemetry::v1::sdk::trace::Recordable, std::default_delete<opentelemetry::v1::sdk::trace::Recordable> >, 18446744073709551615ul> const&)':
span_exporter.cc:(.text+0x3199): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: span_exporter.cc:(.text+0x31a9): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)>::BindTo<opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}>(opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}&)::{lambda(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}::_FUN(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)':
span_exporter.cc:(.text._ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENUlPvS3_SQ_E_4_FUNES14_S3_SQ_[_ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_]+0x1b49): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::sdk::trace::SpanData::SetAttribute(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&)':
span_exporter.cc:(.text._ZN13opentelemetry2v13sdk5trace8SpanData12SetAttributeENS0_5nostd11string_viewERKN4absl12lts_202301257variantIJbiljdPKcS5_NS4_4spanIKbLm18446744073709551615EEENSB_IKiLm18446744073709551615EEENSB_IKlLm18446744073709551615EEENSB_IKjLm18446744073709551615EEENSB_IKdLm18446744073709551615EEENSB_IKS5_Lm18446744073709551615EEEmNSB_IKmLm18446744073709551615EEENSB_IKhLm18446744073709551615EEEEEE[_ZN13opentelemetry2v13sdk5trace8SpanData12SetAttributeENS0_5nostd11string_viewERKN4absl12lts_202301257variantIJbiljdPKcS5_NS4_4spanIKbLm18446744073709551615EEENSB_IKiLm18446744073709551615EEENSB_IKlLm18446744073709551615EEENSB_IKjLm18446744073709551615EEENSB_IKdLm18446744073709551615EEENSB_IKS5_Lm18446744073709551615EEEmNSB_IKmLm18446744073709551615EEENSB_IKhLm18446744073709551615EEEEEE]+0x190a): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)>::BindTo<opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}>(opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}&)::{lambda(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}::operator()(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >) const':
span_exporter.cc:(.text._ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_[_ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_]+0x1ab9): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o): in function `opentelemetry::v1::sdk::trace::TracerProvider::TracerProvider(std::shared_ptr<opentelemetry::v1::sdk::trace::TracerContext>)':
tracer_provider.cc:(.text+0x2ae): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x2e1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o): in function `opentelemetry::v1::sdk::trace::TracerProvider::GetTracer(opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::string_view)':
tracer_provider.cc:(.text+0x10d1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x10e1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x1821): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o):tracer_provider.cc:(.text+0x18b9): more undefined references to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()' follow
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource.cc.o): in function `opentelemetry::v1::sdk::resource::Resource::Create(opentelemetry::v1::sdk::common::AttributeMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
resource.cc:(.text+0x2dae): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource.cc.o): in function `absl::lts_20230125::variant_internal::VisitIndicesResultImpl<absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&>, unsigned long>::type absl::lts_20230125::variant_internal::VisitIndicesSwitch<16ul>::Run<absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&> >(absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&>&&, unsigned long)':
resource.cc:(.text._ZN4absl12lts_2023012516variant_internal18VisitIndicesSwitchILm16EE3RunINS1_17PerformVisitationIRN13opentelemetry2v13sdk6common18AttributeConverterEJRKNS0_7variantIJbiljdPKcNS7_5nostd11string_viewENSF_4spanIKbLm18446744073709551615EEENSH_IKiLm18446744073709551615EEENSH_IKlLm18446744073709551615EEENSH_IKjLm18446744073709551615EEENSH_IKdLm18446744073709551615EEENSH_IKSG_Lm18446744073709551615EEEmNSH_IKmLm18446744073709551615EEENSH_IKhLm18446744073709551615EEEEEEEEEEENS1_22VisitIndicesResultImplIT_JmEE4typeEOS13_m[_ZN4absl12lts_2023012516variant_internal18VisitIndicesSwitchILm16EE3RunINS1_17PerformVisitationIRN13opentelemetry2v13sdk6common18AttributeConverterEJRKNS0_7variantIJbiljdPKcNS7_5nostd11string_viewENSF_4spanIKbLm18446744073709551615EEENSH_IKiLm18446744073709551615EEENSH_IKlLm18446744073709551615EEENSH_IKjLm18446744073709551615EEENSH_IKdLm18446744073709551615EEENSH_IKSG_Lm18446744073709551615EEEmNSH_IKmLm18446744073709551615EEENSH_IKhLm18446744073709551615EEEEEEEEEEENS1_22VisitIndicesResultImplIT_JmEE4typeEOS13_m]+0x1008): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource_detector.cc.o): in function `opentelemetry::v1::sdk::resource::OTELResourceDetector::Detect()':
resource_detector.cc:(.text+0x205): undefined reference to `opentelemetry::v1::sdk::common::GetStringEnvironmentVariable(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(random_id_generator.cc.o): in function `opentelemetry::v1::sdk::trace::RandomIdGenerator::GenerateSpanId()':
random_id_generator.cc:(.text+0xf): undefined reference to `opentelemetry::v1::sdk::common::Random::GenerateRandomBuffer(opentelemetry::v1::nostd::span<unsigned char, 18446744073709551615ul>)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(random_id_generator.cc.o): in function `opentelemetry::v1::sdk::trace::RandomIdGenerator::GenerateTraceId()':
random_id_generator.cc:(.text+0x2d): undefined reference to `opentelemetry::v1::sdk::common::Random::GenerateRandomBuffer(opentelemetry::v1::nostd::span<unsigned char, 18446744073709551615ul>)'
collect2: error: ld returned 1 exit status

I'm really at a loss as to what to do next. There are multiple references to absl and Bad Variant access?

owent commented 1 year ago

find_package(abseil REQUIRED)

find_package(OpenSSL REQUIRED) is also required if you want to use OTLP exporters or http client.

owent commented 1 year ago

I was also checking out another way to link all libraries via g++ itself, and I ran into this

g++ -I/home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/include/ test.cpp -o program -L/home/kmh/vcpkg/installed/x64-linux/lib/ $(ls /home/kmh/vcpkg/installed/x64-linux/lib/ | grep '\.a$' | sed 's/lib/-l/' | sed 's/\.a//')

Contents of /home/kmh/vcpkg/installed/x64-linux/lib/

total 71M
drwxr-xr-x 1 root root 6.3K Jun  9 17:00 .
drwxr-xr-x 1 root root   56 Jun  9 16:30 ..
-rw-r--r-- 1 root root 4.1K Jun  9 16:25 libabsl_bad_any_cast_impl.a
-rw-r--r-- 1 root root 4.3K Jun  9 16:25 libabsl_bad_optional_access.a
-rw-r--r-- 1 root root 4.5K Jun  9 16:25 libabsl_bad_variant_access.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_base.a
-rw-r--r-- 1 root root 4.3K Jun  9 16:25 libabsl_city.a
-rw-r--r-- 1 root root  29K Jun  9 16:25 libabsl_civil_time.a
-rw-r--r-- 1 root root 118K Jun  9 16:25 libabsl_cord.a
-rw-r--r-- 1 root root 121K Jun  9 16:25 libabsl_cord_internal.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_cordz_functions.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_cordz_handle.a
-rw-r--r-- 1 root root  20K Jun  9 16:25 libabsl_cordz_info.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_cordz_sample_token.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_crc32c.a
-rw-r--r-- 1 root root  23K Jun  9 16:25 libabsl_crc_cord_state.a
-rw-r--r-- 1 root root 5.4K Jun  9 16:25 libabsl_crc_cpu_detect.a
-rw-r--r-- 1 root root  20K Jun  9 16:25 libabsl_crc_internal.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_debugging_internal.a
-rw-r--r-- 1 root root  45K Jun  9 16:25 libabsl_demangle_internal.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_die_if_null.a
-rw-r--r-- 1 root root 5.7K Jun  9 16:25 libabsl_examine_stack.a
-rw-r--r-- 1 root root 3.1K Jun  9 16:25 libabsl_exponential_biased.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_failure_signal_handler.a
-rw-r--r-- 1 root root  932 Jun  9 16:25 libabsl_flags.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_flags_commandlineflag.a
-rw-r--r-- 1 root root 3.5K Jun  9 16:25 libabsl_flags_commandlineflag_internal.a
-rw-r--r-- 1 root root  23K Jun  9 16:25 libabsl_flags_config.a
-rw-r--r-- 1 root root  40K Jun  9 16:25 libabsl_flags_internal.a
-rw-r--r-- 1 root root  37K Jun  9 16:25 libabsl_flags_marshalling.a
-rw-r--r-- 1 root root  91K Jun  9 16:25 libabsl_flags_parse.a
-rw-r--r-- 1 root root 3.2K Jun  9 16:25 libabsl_flags_private_handle_accessor.a
-rw-r--r-- 1 root root 6.5K Jun  9 16:25 libabsl_flags_program_name.a
-rw-r--r-- 1 root root  53K Jun  9 16:25 libabsl_flags_reflection.a
-rw-r--r-- 1 root root 5.1K Jun  9 16:25 libabsl_flags_usage.a
-rw-r--r-- 1 root root  65K Jun  9 16:25 libabsl_flags_usage_internal.a
-rw-r--r-- 1 root root  46K Jun  9 16:25 libabsl_graphcycles_internal.a
-rw-r--r-- 1 root root 3.7K Jun  9 16:25 libabsl_hash.a
-rw-r--r-- 1 root root  15K Jun  9 16:25 libabsl_hashtablez_sampler.a
-rw-r--r-- 1 root root  24K Jun  9 16:25 libabsl_int128.a
-rw-r--r-- 1 root root 2.6K Jun  9 16:25 libabsl_leak_check.a
-rw-r--r-- 1 root root 1.3K Jun  9 16:25 libabsl_log_entry.a
-rw-r--r-- 1 root root  21K Jun  9 16:25 libabsl_log_flags.a
-rw-r--r-- 1 root root 9.0K Jun  9 16:25 libabsl_log_globals.a
-rw-r--r-- 1 root root 1.7K Jun  9 16:25 libabsl_log_initialize.a
-rw-r--r-- 1 root root  32K Jun  9 16:25 libabsl_log_internal_check_op.a
-rw-r--r-- 1 root root 2.7K Jun  9 16:25 libabsl_log_internal_conditions.a
-rw-r--r-- 1 root root 6.4K Jun  9 16:25 libabsl_log_internal_format.a
-rw-r--r-- 1 root root 5.6K Jun  9 16:25 libabsl_log_internal_globals.a
-rw-r--r-- 1 root root  18K Jun  9 16:25 libabsl_log_internal_log_sink_set.a
-rw-r--r-- 1 root root  47K Jun  9 16:25 libabsl_log_internal_message.a
-rw-r--r-- 1 root root 1.4K Jun  9 16:25 libabsl_log_internal_nullguard.a
-rw-r--r-- 1 root root 5.9K Jun  9 16:25 libabsl_log_internal_proto.a
-rw-r--r-- 1 root root 3.3K Jun  9 16:25 libabsl_log_severity.a
-rw-r--r-- 1 root root 3.0K Jun  9 16:25 libabsl_log_sink.a
-rw-r--r-- 1 root root 1.9K Jun  9 16:25 libabsl_low_level_hash.a
-rw-r--r-- 1 root root  22K Jun  9 16:25 libabsl_malloc_internal.a
-rw-r--r-- 1 root root 4.5K Jun  9 16:25 libabsl_periodic_sampler.a
-rw-r--r-- 1 root root  13K Jun  9 16:25 libabsl_random_distributions.a
-rw-r--r-- 1 root root  31K Jun  9 16:25 libabsl_random_internal_distribution_test_util.a
-rw-r--r-- 1 root root 5.7K Jun  9 16:25 libabsl_random_internal_platform.a
-rw-r--r-- 1 root root  25K Jun  9 16:25 libabsl_random_internal_pool_urbg.a
-rw-r--r-- 1 root root 3.4K Jun  9 16:25 libabsl_random_internal_randen.a
-rw-r--r-- 1 root root 1.5K Jun  9 16:25 libabsl_random_internal_randen_hwaes.a
-rw-r--r-- 1 root root 3.1K Jun  9 16:25 libabsl_random_internal_randen_hwaes_impl.a
-rw-r--r-- 1 root root 8.3K Jun  9 16:25 libabsl_random_internal_randen_slow.a
-rw-r--r-- 1 root root 4.2K Jun  9 16:25 libabsl_random_internal_seed_material.a
-rw-r--r-- 1 root root 5.2K Jun  9 16:25 libabsl_random_seed_gen_exception.a
-rw-r--r-- 1 root root 3.0K Jun  9 16:25 libabsl_random_seed_sequences.a
-rw-r--r-- 1 root root 6.2K Jun  9 16:25 libabsl_raw_hash_set.a
-rw-r--r-- 1 root root 7.1K Jun  9 16:25 libabsl_raw_logging_internal.a
-rw-r--r-- 1 root root 4.1K Jun  9 16:25 libabsl_scoped_set_env.a
-rw-r--r-- 1 root root 2.9K Jun  9 16:25 libabsl_spinlock_wait.a
-rw-r--r-- 1 root root 5.8K Jun  9 16:25 libabsl_stacktrace.a
-rw-r--r-- 1 root root  43K Jun  9 16:25 libabsl_status.a
-rw-r--r-- 1 root root  15K Jun  9 16:25 libabsl_statusor.a
-rw-r--r-- 1 root root 5.0K Jun  9 16:25 libabsl_strerror.a
-rw-r--r-- 1 root root 180K Jun  9 16:25 libabsl_str_format_internal.a
-rw-r--r-- 1 root root 198K Jun  9 16:25 libabsl_strings.a
-rw-r--r-- 1 root root  12K Jun  9 16:25 libabsl_strings_internal.a
-rw-r--r-- 1 root root  31K Jun  9 16:25 libabsl_symbolize.a
-rw-r--r-- 1 root root  80K Jun  9 16:25 libabsl_synchronization.a
-rw-r--r-- 1 root root  17K Jun  9 16:25 libabsl_throw_delegate.a
-rw-r--r-- 1 root root 109K Jun  9 16:25 libabsl_time.a
-rw-r--r-- 1 root root 196K Jun  9 16:25 libabsl_time_zone.a
-rw-r--r-- 1 root root  11K Jun  9 16:57 libaddress_sorting.a
-rw-r--r-- 1 root root 192K Jun  9 16:26 libcares.a
-rw-r--r-- 1 root root  11M Jun  9 16:30 libcrypto.a
-rw-r--r-- 1 root root 1.3M Jun  9 16:30 libcurl.a
-rw-r--r-- 1 root root  25K Jun  9 16:35 libdescriptor_upb_proto.a
-rw-r--r-- 1 root root 130K Jun  9 16:57 libgpr.a
-rw-r--r-- 1 root root 2.3M Jun  9 16:57 libgrpc++.a
-rw-r--r-- 1 root root  19M Jun  9 16:57 libgrpc.a
-rw-r--r-- 1 root root  39K Jun  9 16:57 libgrpc++_alts.a
-rw-r--r-- 1 root root 1020 Jun  9 16:57 libgrpc++_error_details.a
-rw-r--r-- 1 root root 887K Jun  9 16:57 libgrpc_plugin_support.a
-rw-r--r-- 1 root root 986K Jun  9 16:57 libgrpcpp_channelz.a
-rw-r--r-- 1 root root 682K Jun  9 16:57 libgrpc++_reflection.a
-rw-r--r-- 1 root root 1.4M Jun  9 16:57 libgrpc++_unsecure.a
-rw-r--r-- 1 root root  11M Jun  9 16:57 libgrpc_unsecure.a
-rw-r--r-- 1 root root  69K Jun  9 17:00 libopentelemetry_common.a
-rw-r--r-- 1 root root 168K Jun  9 17:00 libopentelemetry_exporter_in_memory.a
-rw-r--r-- 1 root root  45K Jun  9 17:00 libopentelemetry_exporter_ostream_logs.a
-rw-r--r-- 1 root root 113K Jun  9 17:00 libopentelemetry_exporter_ostream_metrics.a
-rw-r--r-- 1 root root 183K Jun  9 17:00 libopentelemetry_exporter_ostream_span.a
-rw-r--r-- 1 root root  51K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc.a
-rw-r--r-- 1 root root  57K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_client.a
-rw-r--r-- 1 root root  51K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_log.a
-rw-r--r-- 1 root root  52K Jun  9 17:00 libopentelemetry_exporter_otlp_grpc_metrics.a
-rw-r--r-- 1 root root 542K Jun  9 17:00 libopentelemetry_logs.a
-rw-r--r-- 1 root root 1.8M Jun  9 17:00 libopentelemetry_metrics.a
-rw-r--r-- 1 root root 159K Jun  9 17:00 libopentelemetry_otlp_recordable.a
-rw-r--r-- 1 root root 807K Jun  9 17:00 libopentelemetry_proto.a
-rw-r--r-- 1 root root 836K Jun  9 17:00 libopentelemetry_proto_grpc.a
-rw-r--r-- 1 root root 145K Jun  9 17:00 libopentelemetry_resources.a
-rw-r--r-- 1 root root 638K Jun  9 17:00 libopentelemetry_trace.a
-rw-r--r-- 1 root root 3.2K Jun  9 17:00 libopentelemetry_version.a
-rw-r--r-- 1 root root 5.6M Jun  9 16:34 libprotobuf.a
-rw-r--r-- 1 root root 1.3M Jun  9 16:34 libprotobuf-lite.a
-rw-r--r-- 1 root root 6.3M Jun  9 16:34 libprotoc.a
-rw-r--r-- 1 root root 1.2M Jun  9 16:35 libre2.a
-rw-r--r-- 1 root root 1.2M Jun  9 16:30 libssl.a
-rw-r--r-- 1 root root  63K Jun  9 16:35 libupb.a
-rw-r--r-- 1 root root 7.8K Jun  9 16:35 libupb_collections.a
-rw-r--r-- 1 root root 2.4K Jun  9 16:35 libupb_extension_registry.a
-rw-r--r-- 1 root root  940 Jun  9 16:35 libupb_fastdecode.a
-rw-r--r-- 1 root root 100K Jun  9 16:35 libupb_json.a
-rw-r--r-- 1 root root  17K Jun  9 16:35 libupb_mini_table.a
-rw-r--r-- 1 root root  86K Jun  9 16:35 libupb_reflection.a
-rw-r--r-- 1 root root  12K Jun  9 16:35 libupb_textformat.a
-rw-r--r-- 1 root root 3.3K Jun  9 16:35 libupb_utf8_range.a
-rw-r--r-- 1 root root 159K Jun  9 16:30 libz.a
drwxr-xr-x 1 root root 8.4K Jun  9 16:57 pkgconfig

Error :

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::printAttributes(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, absl::lts_20230125::variant<bool, int, unsigned int, long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<bool, std::allocator<bool> >, std::vector<int, std::allocator<int> >, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >, std::vector<unsigned char, std::allocator<unsigned char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, absl::lts_20230125::variant<bool, int, unsigned int, long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<bool, std::allocator<bool> >, std::vector<int, std::allocator<int> >, std::vector<unsigned int, std::allocator<unsigned int> >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >, std::vector<unsigned char, std::allocator<unsigned char> > > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
span_exporter.cc:(.text+0x1055): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::Export(opentelemetry::v1::nostd::span<std::unique_ptr<opentelemetry::v1::sdk::trace::Recordable, std::default_delete<opentelemetry::v1::sdk::trace::Recordable> >, 18446744073709551615ul> const&)':
span_exporter.cc:(.text+0x3199): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: span_exporter.cc:(.text+0x31a9): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)>::BindTo<opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}>(opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}&)::{lambda(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}::_FUN(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)':
span_exporter.cc:(.text._ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENUlPvS3_SQ_E_4_FUNES14_S3_SQ_[_ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_]+0x1b49): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::sdk::trace::SpanData::SetAttribute(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&)':
span_exporter.cc:(.text._ZN13opentelemetry2v13sdk5trace8SpanData12SetAttributeENS0_5nostd11string_viewERKN4absl12lts_202301257variantIJbiljdPKcS5_NS4_4spanIKbLm18446744073709551615EEENSB_IKiLm18446744073709551615EEENSB_IKlLm18446744073709551615EEENSB_IKjLm18446744073709551615EEENSB_IKdLm18446744073709551615EEENSB_IKS5_Lm18446744073709551615EEEmNSB_IKmLm18446744073709551615EEENSB_IKhLm18446744073709551615EEEEEE[_ZN13opentelemetry2v13sdk5trace8SpanData12SetAttributeENS0_5nostd11string_viewERKN4absl12lts_202301257variantIJbiljdPKcS5_NS4_4spanIKbLm18446744073709551615EEENSB_IKiLm18446744073709551615EEENSB_IKlLm18446744073709551615EEENSB_IKjLm18446744073709551615EEENSB_IKdLm18446744073709551615EEENSB_IKS5_Lm18446744073709551615EEEmNSB_IKmLm18446744073709551615EEENSB_IKhLm18446744073709551615EEEEEE]+0x190a): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::nostd::function_ref<bool (opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)>::BindTo<opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}>(opentelemetry::v1::sdk::common::AttributeMap::AttributeMap(opentelemetry::v1::common::KeyValueIterable const&)::{lambda(opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}&)::{lambda(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >)#1}::operator()(void*, opentelemetry::v1::nostd::string_view, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> >) const':
span_exporter.cc:(.text._ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_[_ZZN13opentelemetry2v15nostd12function_refIFbNS1_11string_viewEN4absl12lts_202301257variantIJbiljdPKcS3_NS1_4spanIKbLm18446744073709551615EEENS9_IKiLm18446744073709551615EEENS9_IKlLm18446744073709551615EEENS9_IKjLm18446744073709551615EEENS9_IKdLm18446744073709551615EEENS9_IKS3_Lm18446744073709551615EEEmNS9_IKmLm18446744073709551615EEENS9_IKhLm18446744073709551615EEEEEEEE6BindToIZNS0_3sdk6common12AttributeMapC4ERKNS0_6common16KeyValueIterableEEUlS3_SQ_E_EEvRT_ENKUlPvS3_SQ_E_clES14_S3_SQ_]+0x1ab9): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o): in function `opentelemetry::v1::sdk::trace::TracerProvider::TracerProvider(std::shared_ptr<opentelemetry::v1::sdk::trace::TracerContext>)':
tracer_provider.cc:(.text+0x2ae): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x2e1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o): in function `opentelemetry::v1::sdk::trace::TracerProvider::GetTracer(opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::string_view)':
tracer_provider.cc:(.text+0x10d1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x10e1): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: tracer_provider.cc:(.text+0x1821): undefined reference to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(tracer_provider.cc.o):tracer_provider.cc:(.text+0x18b9): more undefined references to `opentelemetry::v1::sdk::common::internal_log::GlobalLogHandler::GetHandlerAndLevel()' follow
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource.cc.o): in function `opentelemetry::v1::sdk::resource::Resource::Create(opentelemetry::v1::sdk::common::AttributeMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
resource.cc:(.text+0x2dae): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource.cc.o): in function `absl::lts_20230125::variant_internal::VisitIndicesResultImpl<absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&>, unsigned long>::type absl::lts_20230125::variant_internal::VisitIndicesSwitch<16ul>::Run<absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&> >(absl::lts_20230125::variant_internal::PerformVisitation<opentelemetry::v1::sdk::common::AttributeConverter&, absl::lts_20230125::variant<bool, int, long, unsigned int, double, char const*, opentelemetry::v1::nostd::string_view, opentelemetry::v1::nostd::span<bool const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned int const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<double const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<opentelemetry::v1::nostd::string_view const, 18446744073709551615ul>, unsigned long, opentelemetry::v1::nostd::span<unsigned long const, 18446744073709551615ul>, opentelemetry::v1::nostd::span<unsigned char const, 18446744073709551615ul> > const&>&&, unsigned long)':
resource.cc:(.text._ZN4absl12lts_2023012516variant_internal18VisitIndicesSwitchILm16EE3RunINS1_17PerformVisitationIRN13opentelemetry2v13sdk6common18AttributeConverterEJRKNS0_7variantIJbiljdPKcNS7_5nostd11string_viewENSF_4spanIKbLm18446744073709551615EEENSH_IKiLm18446744073709551615EEENSH_IKlLm18446744073709551615EEENSH_IKjLm18446744073709551615EEENSH_IKdLm18446744073709551615EEENSH_IKSG_Lm18446744073709551615EEEmNSH_IKmLm18446744073709551615EEENSH_IKhLm18446744073709551615EEEEEEEEEEENS1_22VisitIndicesResultImplIT_JmEE4typeEOS13_m[_ZN4absl12lts_2023012516variant_internal18VisitIndicesSwitchILm16EE3RunINS1_17PerformVisitationIRN13opentelemetry2v13sdk6common18AttributeConverterEJRKNS0_7variantIJbiljdPKcNS7_5nostd11string_viewENSF_4spanIKbLm18446744073709551615EEENSH_IKiLm18446744073709551615EEENSH_IKlLm18446744073709551615EEENSH_IKjLm18446744073709551615EEENSH_IKdLm18446744073709551615EEENSH_IKSG_Lm18446744073709551615EEEmNSH_IKmLm18446744073709551615EEENSH_IKhLm18446744073709551615EEEEEEEEEEENS1_22VisitIndicesResultImplIT_JmEE4typeEOS13_m]+0x1008): undefined reference to `absl::lts_20230125::variant_internal::ThrowBadVariantAccess()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_resources.a(resource_detector.cc.o): in function `opentelemetry::v1::sdk::resource::OTELResourceDetector::Detect()':
resource_detector.cc:(.text+0x205): undefined reference to `opentelemetry::v1::sdk::common::GetStringEnvironmentVariable(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(random_id_generator.cc.o): in function `opentelemetry::v1::sdk::trace::RandomIdGenerator::GenerateSpanId()':
random_id_generator.cc:(.text+0xf): undefined reference to `opentelemetry::v1::sdk::common::Random::GenerateRandomBuffer(opentelemetry::v1::nostd::span<unsigned char, 18446744073709551615ul>)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_trace.a(random_id_generator.cc.o): in function `opentelemetry::v1::sdk::trace::RandomIdGenerator::GenerateTraceId()':
random_id_generator.cc:(.text+0x2d): undefined reference to `opentelemetry::v1::sdk::common::Random::GenerateRandomBuffer(opentelemetry::v1::nostd::span<unsigned char, 18446744073709551615ul>)'
collect2: error: ld returned 1 exit status

I'm really at a loss as to what to do next. There are multiple references to absl and Bad Variant access?

The link order should be carefully considered.

TheOxFromOutOfTheBox commented 1 year ago

Hi owent, Regarding your comment about link order, I only decided to compile with the .a files I need. Here's my current compile statement.

g++ -I /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/include/ test.cpp ../vcpkg/installed/x64-linux/lib/libopentelemetry_trace.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_common.a ../vcpkg/installed/x64-linux/lib/libabsl_bad_variant_access.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_resources.a  ../vcpkg/installed/x64-linux/lib/libopentelemetry_version.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_logs.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_metrics.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_logs.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_metrics.a 

This removes most of the errors, including absl and the initial span exporter factory error.However some still remain.

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::OStreamSpanExporter(std::ostream&)':
span_exporter.cc:(.text+0x6cf): undefined reference to `opentelemetry::v1::sdk::trace::SpanExporter::SpanExporter()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::~OStreamSpanExporter()':
span_exporter.cc:(.text._ZN13opentelemetry2v18exporter5trace19OStreamSpanExporterD2Ev[_ZN13opentelemetry2v18exporter5trace19OStreamSpanExporterD5Ev]+0x7b): undefined reference to `opentelemetry::v1::sdk::trace::SpanExporter::~SpanExporter()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o): in function `opentelemetry::v1::exporter::trace::OStreamSpanExporter::~OStreamSpanExporter()':
span_exporter.cc:(.text._ZN13opentelemetry2v18exporter5trace19OStreamSpanExporterD0Ev[_ZN13opentelemetry2v18exporter5trace19OStreamSpanExporterD5Ev]+0x71): undefined reference to `opentelemetry::v1::sdk::trace::SpanExporter::~SpanExporter()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a(span_exporter.cc.o):(.data.rel.ro._ZTIN13opentelemetry2v18exporter5trace19OStreamSpanExporterE[_ZTIN13opentelemetry2v18exporter5trace19OStreamSpanExporterE]+0x10): undefined reference to `typeinfo for opentelemetry::v1::sdk::trace::SpanExporter'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../vcpkg/installed/x64-linux/lib/libopentelemetry_resources.a(resource_detector.cc.o): in function `opentelemetry::v1::sdk::resource::OTELResourceDetector::Detect()':
resource_detector.cc:(.text+0x205): undefined reference to `opentelemetry::v1::sdk::common::GetStringEnvironmentVariable(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
collect2: error: ld returned 1 exit status

These are mostly related to only two things

However, I've already included all the relevant files for resources, and all the otel-ostream-exporters. Where else can I find them?

TheOxFromOutOfTheBox commented 1 year ago

So, update.With the g++ thing, the problem was the ordering of the included libs. Final run command

g++ -I /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/include/ ostreamspan.cpp ../vcpkg/installed/x64-linux/lib/libopentelemetry_version.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_span.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_resources.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_trace.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_common.a ../vcpkg/installed/x64-linux/lib/libabsl_bad_variant_access.a  ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_logs.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_exporter_ostream_metrics.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_logs.a ../vcpkg/installed/x64-linux/lib/libopentelemetry_metrics.a 

However, this seems to be too difficult if I even move towards OTLP GRPC, with it including many absl libs,not to mention others like protobuf, grpc and the rest.

So, CMake is the only viable option, however I'm no close to building with the help of the earlier comment as that does not take care of the openSSL issue.It gives me the same error.

owent commented 1 year ago

We have many users using other build system confuse about the linking problem before. Can we add a tool in cmake to make a all in one static library file on Linux and Mac, just like all in one dll on Windows? What's your thoughtsa about this? @open-telemetry/cpp-maintainers

TheOxFromOutOfTheBox commented 1 year ago

Hey,given that I had issues with my previous CMakeLists.txt , I decided to start anew, trying to find proper methods to include the files.I ended up with something that kinda resembles the g++ include statement I was doing before, which doesnt seem sustainable. The previous method I was unable to set proper directories for including opentelemetry libs.Would appreciate some guidance.

Current CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
project(otel-test)

set(VCPKG_ROOT "/home/kmh/vcpkg/" CACHE PATH "Path to vcpkg root dir")

set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")

set(CMAKE_CXX_STANDARD 17)

set(OTEL_INCLUDE_DIR "${VCPKG_ROOT}/packages/opentelemetry-cpp_x64-linux/include/")

set(SOURCES test.cpp)

set(OTEL_LIBS_DIR "${VCPKG_ROOT}/installed/x64-linux/lib/")

add_executable(myexe ${SOURCES})

target_include_directories(myexe PRIVATE ${OTEL_INCLUDE_DIR})

link_directories(
    ${OTEL_LIBS_DIR}/opentelemetry_exporter_otlp_grpc.a
)

target_link_libraries(myexe
${OTEL_LIBS_DIR}/libopentelemetry_exporter_otlp_grpc_client.a
${OTEL_LIBS_DIR}/libgrpc++.a
${OTEL_LIBS_DIR}/libopentelemetry_exporter_otlp_grpc.a
${OTEL_LIBS_DIR}/libopentelemetry_otlp_recordable.a
${OTEL_LIBS_DIR}/libopentelemetry_proto.a
${OTEL_LIBS_DIR}/libopentelemetry_proto_grpc.a
${OTEL_LIBS_DIR}/libprotobuf.a
${OTEL_LIBS_DIR}/libopentelemetry_trace.a
${OTEL_LIBS_DIR}/libopentelemetry_logs.a
${OTEL_LIBS_DIR}/libopentelemetry_metrics.a
${OTEL_LIBS_DIR}/libopentelemetry_resources.a
${OTEL_LIBS_DIR}/libopentelemetry_common.a
${OTEL_LIBS_DIR}/libabsl_bad_variant_access.a
)

I still have some unresolved reference errors,however less than before.

[ 50%] Linking CXX executable myexe
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_otlp_grpc.a(otlp_grpc_exporter.cc.o): in function `opentelemetry::v1::exporter::otlp::OtlpGrpcExporter::OtlpGrpcExporter(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)':
otlp_grpc_exporter.cc:(.text+0x5af): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::MakeTraceServiceStub(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_otlp_grpc.a(otlp_grpc_exporter.cc.o): in function `opentelemetry::v1::exporter::otlp::OtlpGrpcExporter::Export(opentelemetry::v1::nostd::span<std::unique_ptr<opentelemetry::v1::sdk::trace::Recordable, std::default_delete<opentelemetry::v1::sdk::trace::Recordable> >, 18446744073709551615ul> const&)':
otlp_grpc_exporter.cc:(.text+0xa81): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::MakeClientContext(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0xaa7): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::DelegateExport(opentelemetry::proto::collector::trace::v1::TraceService::StubInterface*, grpc::ClientContext*, opentelemetry::proto::collector::trace::v1::ExportTraceServiceRequest const&, opentelemetry::proto::collector::trace::v1::ExportTraceServiceResponse*)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0xafc): undefined reference to `grpc::ClientContext::~ClientContext()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0x1413): undefined reference to `opentelemetry::v1::exporter::otlp::grpc_utils::grpc_status_code_to_string(grpc::StatusCode)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/myexe.dir/build.make:114: myexe] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/myexe.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

I'm trying to run this sample otlp example given by you guys.

// #include "opentelemetry/exporters/ostream/span_exporter_factory.h"
// #include "opentelemetry/exporters/ostream/span_exporter.h"
#include "utils.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
#include "opentelemetry/trace/provider.h"

namespace trace_api      = opentelemetry::trace;
namespace trace_sdk      = opentelemetry::sdk::trace;
// namespace trace_exporter = opentelemetry::exporter::trace;
namespace otlp      = opentelemetry::exporter::otlp;

namespace
{
opentelemetry::exporter::otlp::OtlpGrpcExporterOptions opts;
void InitTracer()
{
  // Create OTLP exporter instance
  auto exporter  = otlp::OtlpGrpcExporterFactory::Create(opts);
  auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter));
  std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
      trace_sdk::TracerProviderFactory::Create(std::move(processor));
  // Set the global trace provider
  trace_api::Provider::SetTracerProvider(provider);
}

void CleanupTracer()
{

  std::shared_ptr<opentelemetry::trace::TracerProvider> none;
  trace_api::Provider::SetTracerProvider(none);
}
}  // namespace

int main()
{
  // Removing this line will leave the default noop TracerProvider in place.
  InitTracer();

    auto provider = trace_api::Provider::GetTracerProvider();
    auto tracer = provider->GetTracer("foo_library");

  //create a span
    auto span = tracer->StartSpan("first-span");
    auto scope = tracer->WithActiveSpan(span);
    //inner ops
    std::this_thread::sleep_for(std::chrono::milliseconds(200));
    span->End();

    std::cout<<"Heloworld!"<<std::endl;
    CleanupTracer();
    return 0;
}
owent commented 1 year ago

Hey,given that I had issues with my previous CMakeLists.txt , I decided to start anew, trying to find proper methods to include the files.I ended up with something that kinda resembles the g++ include statement I was doing before, which doesnt seem sustainable. The previous method I was unable to set proper directories for including opentelemetry libs.Would appreciate some guidance.

Current CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
project(otel-test)

set(VCPKG_ROOT "/home/kmh/vcpkg/" CACHE PATH "Path to vcpkg root dir")

set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")

set(CMAKE_CXX_STANDARD 17)

set(OTEL_INCLUDE_DIR "${VCPKG_ROOT}/packages/opentelemetry-cpp_x64-linux/include/")

set(SOURCES test.cpp)

set(OTEL_LIBS_DIR "${VCPKG_ROOT}/installed/x64-linux/lib/")

add_executable(myexe ${SOURCES})

target_include_directories(myexe PRIVATE ${OTEL_INCLUDE_DIR})

link_directories(
    ${OTEL_LIBS_DIR}/opentelemetry_exporter_otlp_grpc.a
)

target_link_libraries(myexe
${OTEL_LIBS_DIR}/libopentelemetry_exporter_otlp_grpc_client.a
${OTEL_LIBS_DIR}/libgrpc++.a
${OTEL_LIBS_DIR}/libopentelemetry_exporter_otlp_grpc.a
${OTEL_LIBS_DIR}/libopentelemetry_otlp_recordable.a
${OTEL_LIBS_DIR}/libopentelemetry_proto.a
${OTEL_LIBS_DIR}/libopentelemetry_proto_grpc.a
${OTEL_LIBS_DIR}/libprotobuf.a
${OTEL_LIBS_DIR}/libopentelemetry_trace.a
${OTEL_LIBS_DIR}/libopentelemetry_logs.a
${OTEL_LIBS_DIR}/libopentelemetry_metrics.a
${OTEL_LIBS_DIR}/libopentelemetry_resources.a
${OTEL_LIBS_DIR}/libopentelemetry_common.a
${OTEL_LIBS_DIR}/libabsl_bad_variant_access.a
)

I still have some unresolved reference errors,however less than before.

[ 50%] Linking CXX executable myexe
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_otlp_grpc.a(otlp_grpc_exporter.cc.o): in function `opentelemetry::v1::exporter::otlp::OtlpGrpcExporter::OtlpGrpcExporter(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)':
otlp_grpc_exporter.cc:(.text+0x5af): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::MakeTraceServiceStub(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/installed/x64-linux/lib//libopentelemetry_exporter_otlp_grpc.a(otlp_grpc_exporter.cc.o): in function `opentelemetry::v1::exporter::otlp::OtlpGrpcExporter::Export(opentelemetry::v1::nostd::span<std::unique_ptr<opentelemetry::v1::sdk::trace::Recordable, std::default_delete<opentelemetry::v1::sdk::trace::Recordable> >, 18446744073709551615ul> const&)':
otlp_grpc_exporter.cc:(.text+0xa81): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::MakeClientContext(opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const&)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0xaa7): undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcClient::DelegateExport(opentelemetry::proto::collector::trace::v1::TraceService::StubInterface*, grpc::ClientContext*, opentelemetry::proto::collector::trace::v1::ExportTraceServiceRequest const&, opentelemetry::proto::collector::trace::v1::ExportTraceServiceResponse*)'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0xafc): undefined reference to `grpc::ClientContext::~ClientContext()'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: otlp_grpc_exporter.cc:(.text+0x1413): undefined reference to `opentelemetry::v1::exporter::otlp::grpc_utils::grpc_status_code_to_string(grpc::StatusCode)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/myexe.dir/build.make:114: myexe] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/myexe.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

I'm trying to run this sample otlp example given by you guys.

// #include "opentelemetry/exporters/ostream/span_exporter_factory.h"
// #include "opentelemetry/exporters/ostream/span_exporter.h"
#include "utils.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
#include "opentelemetry/trace/provider.h"

namespace trace_api      = opentelemetry::trace;
namespace trace_sdk      = opentelemetry::sdk::trace;
// namespace trace_exporter = opentelemetry::exporter::trace;
namespace otlp      = opentelemetry::exporter::otlp;

namespace
{
opentelemetry::exporter::otlp::OtlpGrpcExporterOptions opts;
void InitTracer()
{
  // Create OTLP exporter instance
  auto exporter  = otlp::OtlpGrpcExporterFactory::Create(opts);
  auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter));
  std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
      trace_sdk::TracerProviderFactory::Create(std::move(processor));
  // Set the global trace provider
  trace_api::Provider::SetTracerProvider(provider);
}

void CleanupTracer()
{

  std::shared_ptr<opentelemetry::trace::TracerProvider> none;
  trace_api::Provider::SetTracerProvider(none);
}
}  // namespace

int main()
{
  // Removing this line will leave the default noop TracerProvider in place.
  InitTracer();

    auto provider = trace_api::Provider::GetTracerProvider();
    auto tracer = provider->GetTracer("foo_library");

  //create a span
    auto span = tracer->StartSpan("first-span");
    auto scope = tracer->WithActiveSpan(span);
    //inner ops
    std::this_thread::sleep_for(std::chrono::milliseconds(200));
    span->End();

    std::cout<<"Heloworld!"<<std::endl;
    CleanupTracer();
    return 0;
}

Please set CMAKE_TOOLCHAIN_FILE before project(otel-test) and use find_package(opentelemetry-cpp) to find otel-cpp and use target_link_libraries(<EXE> opentelemetry-cpp::trace opentelemetry-cpp::ostream_span_exporter opentelemetry-cpp::otlp_grpc_exporter) to import trace, ostream exporter and OTLP exporter.Do not include directories and link libraries manually.

lalitb commented 1 year ago

Can we add a tool in cmake to make a all in one static library file on Linux and Mac, just like all in one dll on Windows?

Good point. But I feel this will make maintenance difficult. Single DLL support was added to handle special case for difficult in sharing symbols across multiple DLLs.

TheOxFromOutOfTheBox commented 1 year ago

Hi, Thanks a lot for the quick response. As per your suggestion, I updated my cmakelists.txt . I'm now facing an error regarding ssl_get_peer_certificates which I thought were related to openSSL,so I included it however the issue persists.

CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")

project(otel-test)

set(VCPKG_ROOT "/home/kmh/vcpkg/" CACHE PATH "Path to vcpkg root dir")

set(CMAKE_CXX_STANDARD 17)

set(OTEL_INCLUDE_DIR "${VCPKG_ROOT}/packages/opentelemetry-cpp_x64-linux/include/")

set(SOURCES test.cpp)

set(OTEL_LIBS_DIR "${VCPKG_ROOT}/installed/x64-linux/lib/")

add_executable(myexe ${SOURCES})

find_package(opentelemetry-cpp)
find_package(gRPC)
find_package(OpenSSL REQUIRED)

target_link_libraries(myexe opentelemetry-cpp::trace opentelemetry-cpp::ostream_span_exporter opentelemetry-cpp::otlp_grpc_exporter)

Error :

[ 50%] Linking CXX executable myexe
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc.a(json_token.cc.o): in function `compute_and_encode_signature(grpc_auth_json_key const*, char const*, char const*)':
/home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/lib/security/credentials/jwt/json_token.cc:252: undefined reference to `EVP_DigestSignUpdate'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc.a(ssl_transport_security.cc.o): in function `ssl_handshaker_result_extract_peer(tsi_handshaker_result const*, tsi_peer*)':
/home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/ssl_transport_security.cc:1277: undefined reference to `SSL_get1_peer_certificate'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/myexe.dir/build.make:183: myexe] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/myexe.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2

Thanks again for responding.

EDIT : I realized I only found the package but didn't link the openssl library anywhere.I've tried variations like openssl , OpenSSL, open-ssl and openSSL but to no avail.

updated relevant part of CMakeLists.txt

find_package(opentelemetry-cpp)
find_package(gRPC)
set(OPENSSL_ROOT_DIR "/home/kmh/vcpkg/packages/openssl_x64-linux/")
find_package(OpenSSL REQUIRED)

target_link_libraries(myexe opentelemetry-cpp::trace opentelemetry-cpp::ostream_span_exporter opentelemetry-cpp::otlp_grpc_exporter openssl)
owent commented 1 year ago

Can we add a tool in cmake to make a all in one static library file on Linux and Mac, just like all in one dll on Windows?

Good point. But I feel this will make maintenance difficult. Single DLL support was added to handle special case for difficult in sharing symbols across multiple DLLs.

I am using ar to create an archive called libopentelemetry_packed.a, which contains all the .a files from libopentelemetry_*.a in our internal version of otel-cpp. This archive is approximately 280MB in size when built in RelWithDebInfo mode, and it can only be exported manually. Therefore, I'm wondering whether it is worth doing.

TheOxFromOutOfTheBox commented 1 year ago

Update : I read in the openssl library usage section to use it like this

find_package(OpenSSL REQUIRED)
target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)

Updated CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")

project(otel-test)

set(VCPKG_ROOT "/home/kmh/vcpkg/" CACHE PATH "Path to vcpkg root dir")

set(CMAKE_CXX_STANDARD 17)

set(OTEL_INCLUDE_DIR "${VCPKG_ROOT}/packages/opentelemetry-cpp_x64-linux/include/")

set(SOURCES test.cpp)

set(OTEL_LIBS_DIR "${VCPKG_ROOT}/installed/x64-linux/lib/")

add_executable(myexe ${SOURCES})

find_package(opentelemetry-cpp)
find_package(gRPC)
set(OPENSSL_LIBS_DIR "/home/kmh/vcpkg/packages/openssl_x64-linux/")
find_package(OpenSSL REQUIRED PATHS "${OPENSSL_ROOT_DIR}")

if(OpenSSL_FOUND)
message(STATUS"found it man ${OPENSSL_VERSION}")
endif()

target_link_libraries(myexe opentelemetry-cpp::trace opentelemetry-cpp::ostream_span_exporter opentelemetry-cpp::otlp_grpc_exporter OpenSSL::SSL OpenSSL::Crypto )

However my error is now

-- Found RE2 via CMake.
CMake Error at CMakeLists.txt:21 (find_package):
  Could not find a package configuration file provided by "OpenSSL" with any
  of the following names:

    OpenSSLConfig.cmake
    openssl-config.cmake

  Add the installation prefix of "OpenSSL" to CMAKE_PREFIX_PATH or set
  "OpenSSL_DIR" to a directory containing one of the above files.  If
  "OpenSSL" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!

I know that usually the .cmake file is in /share folder, however mine doesn't have that

kmh@localhost:~/vcpkg/packages/openssl_x64-linux/share/openssl> ls -alh
total 36K
drwxr-xr-x 1 root root   94 Jun  9 16:30 .
drwxr-xr-x 1 root root   14 Jun  9 16:30 ..
-rw-r--r-- 1 root root  10K May 30 17:43 copyright
-rw-r--r-- 1 root root  172 Jun  5 11:46 usage
-rw-r--r-- 1 root root 3.6K Jun  9 16:30 vcpkg_abi_info.txt
-rw-r--r-- 1 root root  15K Jun  9 16:30 vcpkg.spdx.json

If I try to link the libraries directly as I have been advised not to, I still get the error I posted in my previous comment.

TheOxFromOutOfTheBox commented 1 year ago

Update number 2:

I was able to see on running nm /home/kmh/vcpkg/installed/x64-linux/lib/libcrypto.a | grep "EVP_DigestSignU" and similar for the other one that these symbols were there in the .a lib files that were built, however my cmake still doesn't work.

On running cmake --build . --verbose I found that its linking the openssl library from usr/local as well as the .a files I added so it must be an ordering issue of sorts.

However I'm unable to remove the flag from the compilation, after trying

The g++ command gives even more undefined reference errors, even though I could find those symbols in the files.

Part of the error:

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc.a(aes_gcm.cc.o): in function `aes_gcm_rekey_if_required(gsec_aes_gcm_aead_crypter*, unsigned char const*, char**)':
/home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:238: undefined reference to `EVP_DecryptInit_ex'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc.a(aes_gcm.cc.o): in function `gsec_aes_gcm_aead_crypter_encrypt_iovec(gsec_aead_crypter*, unsigned char const*, unsigned long, iovec const*, unsigned long, iovec const*, unsigned long, iovec, unsigned long*, char**)':
/home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:293: undefined reference to `EVP_EncryptInit_ex'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:311: undefined reference to `EVP_EncryptUpdate'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:344: undefined reference to `EVP_EncryptUpdate'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:357: undefined reference to `EVP_EncryptFinal_ex'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/kmh/vcpkg/buildtrees/grpc/src/v1.51.1-1066d25324.clean/src/core/tsi/alts/crypt/aes_gcm.cc:373: undefined reference to `EVP_CIPHER_CTX_ctrl'
owent commented 1 year ago

I'm not sure the problem in your system. But I have a ci job to use vcpkg to import otel-cpp's dependencis and it works well.(All packaged are imported by find_package(...))

cmake will try to find package in PATH, this document may help https://cmake.org/cmake/help/v3.27/command/find_package.html.

TheOxFromOutOfTheBox commented 1 year ago

hey owen, I'm not sure I understand what I should do. could you share the cmake file for the gcc+vcpkg ci job that you are running?that would be very helpful in testing whether the issue is in my system or with my current vcpkg installation

owent commented 1 year ago

hey owen, I'm not sure I understand what I should do. could you share the cmake file for the gcc+vcpkg ci job that you are running?that would be very helpful in testing whether the issue is in my system or with my current vcpkg installation

Sorry for the delay, the sample is a bit complicated https://github.com/atframework/cmake-toolset/blob/main/ci/do_ci.sh#L232

TheOxFromOutOfTheBox commented 1 year ago

Hey owen, Sorry for the delay on my end. I still couldn't get find_package to recognize libssl.a and libcrypto.a , so I had to end up using the output from cmake --build . --verbose and end up reordering the libs.

The issue that I've found is that opentelemetry-cpp and its libs make use of grpc, which in turn makes use of openssl . However when I add target_link_libraries pointing directly to the absolute paths of the ssl libs, they are placed before the libgrpc files are included, leading to undefined reference errors.Moving the order of libssl.a and libcrypto.a led me to being able to compile the program.

However this is still not a feasible way.How would I go around changing up the order in cmake?

The final compilation command as a Makefile

# the compiler: gcc for C program, define as g++ for C++
CC = g++

# compiler flags:
#  -g     - this flag adds debugging information to the executable file
#  -Wall  - this flag is used to turn on most compiler warnings
CFLAGS  = -Wall
SLIBS_LINKED = /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_trace.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_exporter_ostream_span.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_exporter_otlp_grpc.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_metrics.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_exporter_otlp_grpc_metrics.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_otlp_recordable.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_trace.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_metrics.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_logs.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_resources.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_exporter_otlp_grpc_client.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_common.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_bad_any_cast_impl.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_proto_grpc.a /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/debug/lib/libopentelemetry_proto.a /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc++.a /usr/local/lib64/libprotobuf.a /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgrpc.a /home/kmh/vcpkg/installed/x64-linux/lib/libssl.a /home/kmh/vcpkg/installed/x64-linux/lib/libcrypto.a /usr/lib64/libz.so /home/kmh/vcpkg/packages/c-ares_x64-linux/debug/lib/libcares.a /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libaddress_sorting.a /home/kmh/vcpkg/packages/re2_x64-linux/debug/lib/libre2.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_raw_hash_set.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_hashtablez_sampler.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_hash.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_city.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_low_level_hash.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_statusor.a /home/kmh/vcpkg/packages/grpc_x64-linux/debug/lib/libgpr.a -ldl -lm -lrt /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_json.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_textformat.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_reflection.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_collections.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_mini_table.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_fastdecode.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_utf8_range.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libupb_extension_registry.a /home/kmh/vcpkg/packages/upb_x64-linux/debug/lib/libdescriptor_upb_proto.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_bad_variant_access.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_status.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_strerror.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_distributions.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_seed_sequences.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_pool_urbg.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_randen.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_randen_hwaes.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_randen_hwaes_impl.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_randen_slow.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_platform.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_internal_seed_material.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_random_seed_gen_exception.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_cord.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_bad_optional_access.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_cordz_info.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_cord_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_cordz_functions.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_exponential_biased.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_cordz_handle.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_synchronization.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_graphcycles_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_stacktrace.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_symbolize.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_malloc_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_debugging_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_demangle_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_time.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_civil_time.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_time_zone.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_crc_cord_state.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_crc32c.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_crc_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_crc_cpu_detect.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_str_format_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_strings.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_throw_delegate.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_strings_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_base.a -pthread /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_raw_logging_internal.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_log_severity.a /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_spinlock_wait.a -lrt /home/kmh/vcpkg/packages/abseil_x64-linux/debug/lib/libabsl_int128.a
INCLUDE_PATH = /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/include
# The build target 
TARGET = test1

all: $(TARGET)

$(TARGET): $(TARGET).cpp
    $(CC) $(CFLAGS) -I$(INCLUDE_PATH) -o $(TARGET) $(TARGET).cpp $(SLIBS_LINKED)

clean:
    $(RM) $(TARGET)
owent commented 1 year ago

Could you try to use --debug-find-pkg=OpenSSL to find out why openssl can not be found?

TheOxFromOutOfTheBox commented 1 year ago

Should I be running that in the command line or somewhere in the cmake file?

owent commented 1 year ago

Should I be running that in the command line or somewhere in the cmake file?

The is option can be added in command line.It's not a variable in cmake file.

TheOxFromOutOfTheBox commented 1 year ago

Hey, here is the debug output

Running with debug output on for the `find` commands.
CMake Debug Log at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  find_package considered the following paths for absl.cmake

    /usr/share/cmake/Modules/Findabsl.cmake

  The file was not found.

    /home/kmh/vcpkg/packages/abseil_x64-linux/share/absl/abslConfig.cmake

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake:87 (find_dependency)
  CMakeLists.txt:18 (find_package)

CMake Debug Log at CMakeLists.txt:18 (find_package):
  find_package considered the following paths for opentelemetry-cpp.cmake

    /usr/share/cmake/Modules/Findopentelemetry-cpp.cmake

  The file was not found.

    /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cppConfig.cmake
    /home/kmh/vcpkg/packages/opentelemetry-cpp_x64-linux/share/opentelemetry-cpp/opentelemetry-cpp-config.cmake

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/python/bin/lib/ from PATH_SUFFIXES while adding architecture
  paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path
  /usr/local/python/bin/ to PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/python/bin/ from PATH_SUFFIXES while adding architecture paths
  for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/openssl/bin/lib/ from PATH_SUFFIXES while adding architecture
  paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path
  /usr/local/openssl/bin/ to PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/openssl/bin/ from PATH_SUFFIXES while adding architecture paths
  for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /home/kmh/bin/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /home/kmh/bin/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /home/kmh/bin/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/bin/lib/ from PATH_SUFFIXES while adding architecture paths for
  suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/bin/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/local/bin/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/bin/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/bin/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/bin/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /bin/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /bin/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /bin/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/local/lib/lib/ from PATH_SUFFIXES while adding architecture paths for
  suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/lib64/
  to PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/lib/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/local/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/lib64/
  to PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/lib/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/local/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/local/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/local/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/lib/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib64/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib64/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /lib/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /lib64/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /lib/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix
  /usr/X11R6/lib/lib/ from PATH_SUFFIXES while adding architecture paths for
  suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/X11R6/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/X11R6/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/X11R6/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/pkg/lib/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/pkg/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/pkg/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/pkg/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /opt/lib/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /opt/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /opt/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /opt/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /opt/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/lib/X11/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib64/X11/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) added replacement path /usr/lib/X11/ to
  PATH_SUFFIXES for architecture suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /usr/lib/X11/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /registry/lib/
  from PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /registry/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /zlib/lib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library(ZLIB_LIBRARY_DEBUG) removed original suffix /zlib/ from
  PATH_SUFFIXES while adding architecture paths for suffix '64'
Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /usr/share/cmake/Modules/FindZLIB.cmake:82 (find_library):
  find_library called with the following settings:

    VAR: ZLIB_LIBRARY_DEBUG
    NAMES: "zd"
           "zlibd"
           "zdlld"
           "zlibd1"
           "zlib1d"
           "zlibstaticd"
    Documentation: Path to a library.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_library considered the following locations:

    /usr/local/python/bin/(lib)zd(\.so|\.a)
    /usr/local/python/bin/(lib)zlibd(\.so|\.a)
    /usr/local/python/bin/(lib)zdlld(\.so|\.a)
    /usr/local/python/bin/(lib)zlibd1(\.so|\.a)
    /usr/local/python/bin/(lib)zlib1d(\.so|\.a)
    /usr/local/python/bin/(lib)zlibstaticd(\.so|\.a)
    /usr/local/openssl/bin/(lib)zd(\.so|\.a)
    /usr/local/openssl/bin/(lib)zlibd(\.so|\.a)
    /usr/local/openssl/bin/(lib)zdlld(\.so|\.a)
    /usr/local/openssl/bin/(lib)zlibd1(\.so|\.a)
    /usr/local/openssl/bin/(lib)zlib1d(\.so|\.a)
    /usr/local/openssl/bin/(lib)zlibstaticd(\.so|\.a)
    /home/kmh/bin/(lib)zd(\.so|\.a)
    /home/kmh/bin/(lib)zlibd(\.so|\.a)
    /home/kmh/bin/(lib)zdlld(\.so|\.a)
    /home/kmh/bin/(lib)zlibd1(\.so|\.a)
    /home/kmh/bin/(lib)zlib1d(\.so|\.a)
    /home/kmh/bin/(lib)zlibstaticd(\.so|\.a)
    /usr/local/bin/(lib)zd(\.so|\.a)
    /usr/local/bin/(lib)zlibd(\.so|\.a)
    /usr/local/bin/(lib)zdlld(\.so|\.a)
    /usr/local/bin/(lib)zlibd1(\.so|\.a)
    /usr/local/bin/(lib)zlib1d(\.so|\.a)
    /usr/local/bin/(lib)zlibstaticd(\.so|\.a)
    /usr/bin/(lib)zd(\.so|\.a)
    /usr/bin/(lib)zlibd(\.so|\.a)
    /usr/bin/(lib)zdlld(\.so|\.a)
    /usr/bin/(lib)zlibd1(\.so|\.a)
    /usr/bin/(lib)zlib1d(\.so|\.a)
    /usr/bin/(lib)zlibstaticd(\.so|\.a)
    /bin/(lib)zd(\.so|\.a)
    /bin/(lib)zlibd(\.so|\.a)
    /bin/(lib)zdlld(\.so|\.a)
    /bin/(lib)zlibd1(\.so|\.a)
    /bin/(lib)zlib1d(\.so|\.a)
    /bin/(lib)zlibstaticd(\.so|\.a)
    /usr/local/lib64/(lib)zd(\.so|\.a)
    /usr/local/lib64/(lib)zlibd(\.so|\.a)
    /usr/local/lib64/(lib)zdlld(\.so|\.a)
    /usr/local/lib64/(lib)zlibd1(\.so|\.a)
    /usr/local/lib64/(lib)zlib1d(\.so|\.a)
    /usr/local/lib64/(lib)zlibstaticd(\.so|\.a)
    /usr/local/lib/(lib)zd(\.so|\.a)
    /usr/local/lib/(lib)zlibd(\.so|\.a)
    /usr/local/lib/(lib)zdlld(\.so|\.a)
    /usr/local/lib/(lib)zlibd1(\.so|\.a)
    /usr/local/lib/(lib)zlib1d(\.so|\.a)
    /usr/local/lib/(lib)zlibstaticd(\.so|\.a)
    /usr/local/lib64/(lib)zd(\.so|\.a)
    /usr/local/lib64/(lib)zlibd(\.so|\.a)
    /usr/local/lib64/(lib)zdlld(\.so|\.a)
    /usr/local/lib64/(lib)zlibd1(\.so|\.a)
    /usr/local/lib64/(lib)zlib1d(\.so|\.a)
    /usr/local/lib64/(lib)zlibstaticd(\.so|\.a)
    /usr/local/lib/(lib)zd(\.so|\.a)
    /usr/local/lib/(lib)zlibd(\.so|\.a)
    /usr/local/lib/(lib)zdlld(\.so|\.a)
    /usr/local/lib/(lib)zlibd1(\.so|\.a)
    /usr/local/lib/(lib)zlib1d(\.so|\.a)
    /usr/local/lib/(lib)zlibstaticd(\.so|\.a)
    /usr/local/(lib)zd(\.so|\.a)
    /usr/local/(lib)zlibd(\.so|\.a)
    /usr/local/(lib)zdlld(\.so|\.a)
    /usr/local/(lib)zlibd1(\.so|\.a)
    /usr/local/(lib)zlib1d(\.so|\.a)
    /usr/local/(lib)zlibstaticd(\.so|\.a)
    /usr/lib64/(lib)zd(\.so|\.a)
    /usr/lib64/(lib)zlibd(\.so|\.a)
    /usr/lib64/(lib)zdlld(\.so|\.a)
    /usr/lib64/(lib)zlibd1(\.so|\.a)
    /usr/lib64/(lib)zlib1d(\.so|\.a)
    /usr/lib64/(lib)zlibstaticd(\.so|\.a)
    /usr/lib/(lib)zd(\.so|\.a)
    /usr/lib/(lib)zlibd(\.so|\.a)
    /usr/lib/(lib)zdlld(\.so|\.a)
    /usr/lib/(lib)zlibd1(\.so|\.a)
    /usr/lib/(lib)zlib1d(\.so|\.a)
    /usr/lib/(lib)zlibstaticd(\.so|\.a)
    /usr/lib64/(lib)zd(\.so|\.a)
    /usr/lib64/(lib)zlibd(\.so|\.a)
    /usr/lib64/(lib)zdlld(\.so|\.a)
    /usr/lib64/(lib)zlibd1(\.so|\.a)
    /usr/lib64/(lib)zlib1d(\.so|\.a)
    /usr/lib64/(lib)zlibstaticd(\.so|\.a)
    /usr/lib/(lib)zd(\.so|\.a)
    /usr/lib/(lib)zlibd(\.so|\.a)
    /usr/lib/(lib)zdlld(\.so|\.a)
    /usr/lib/(lib)zlibd1(\.so|\.a)
    /usr/lib/(lib)zlib1d(\.so|\.a)
    /usr/lib/(lib)zlibstaticd(\.so|\.a)
    /usr/(lib)zd(\.so|\.a)
    /usr/(lib)zlibd(\.so|\.a)
    /usr/(lib)zdlld(\.so|\.a)
    /usr/(lib)zlibd1(\.so|\.a)
    /usr/(lib)zlib1d(\.so|\.a)
    /usr/(lib)zlibstaticd(\.so|\.a)
    /lib64/(lib)zd(\.so|\.a)
    /lib64/(lib)zlibd(\.so|\.a)
    /lib64/(lib)zdlld(\.so|\.a)
    /lib64/(lib)zlibd1(\.so|\.a)
    /lib64/(lib)zlib1d(\.so|\.a)
    /lib64/(lib)zlibstaticd(\.so|\.a)
    /lib/(lib)zd(\.so|\.a)
    /lib/(lib)zlibd(\.so|\.a)
    /lib/(lib)zdlld(\.so|\.a)
    /lib/(lib)zlibd1(\.so|\.a)
    /lib/(lib)zlib1d(\.so|\.a)
    /lib/(lib)zlibstaticd(\.so|\.a)
    /opt/(lib)zd(\.so|\.a)
    /opt/(lib)zlibd(\.so|\.a)
    /opt/(lib)zdlld(\.so|\.a)
    /opt/(lib)zlibd1(\.so|\.a)
    /opt/(lib)zlib1d(\.so|\.a)
    /opt/(lib)zlibstaticd(\.so|\.a)
    /usr/lib64/X11/(lib)zd(\.so|\.a)
    /usr/lib64/X11/(lib)zlibd(\.so|\.a)
    /usr/lib64/X11/(lib)zdlld(\.so|\.a)
    /usr/lib64/X11/(lib)zlibd1(\.so|\.a)
    /usr/lib64/X11/(lib)zlib1d(\.so|\.a)
    /usr/lib64/X11/(lib)zlibstaticd(\.so|\.a)
    /usr/lib/X11/(lib)zd(\.so|\.a)
    /usr/lib/X11/(lib)zlibd(\.so|\.a)
    /usr/lib/X11/(lib)zdlld(\.so|\.a)
    /usr/lib/X11/(lib)zlibd1(\.so|\.a)
    /usr/lib/X11/(lib)zlib1d(\.so|\.a)
    /usr/lib/X11/(lib)zlibstaticd(\.so|\.a)

  The item was not found.

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:6 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:9 (find_package):
    /usr/local/lib64/cmake/protobuf/ProtobufConfig.cmake
    /usr/local/lib64/cmake/protobuf/protobuf-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/modules/Findc-ares.cmake:18 (find_package):
    /home/kmh/vcpkg/packages/c-ares_x64-linux/share/c-ares/c-aresConfig.cmake
    /home/kmh/vcpkg/packages/c-ares_x64-linux/share/c-ares/c-ares-config.cmake

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:15 (find_package)
  CMakeLists.txt:19 (find_package)

CMake Debug Log at /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/modules/Findre2.cmake:15 (find_package):
    /home/kmh/vcpkg/packages/re2_x64-linux/share/re2/re2Config.cmake

Call Stack (most recent call first):
  /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:21 (find_package)
  CMakeLists.txt:19 (find_package)

-- Found RE2 via CMake.
CMake Debug Log at /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake:24 (find_package):
    /home/kmh/vcpkg/packages/upb_x64-linux/share/upb/upbConfig.cmake
    /home/kmh/vcpkg/packages/upb_x64-linux/share/upb/upb-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)

CMake Debug Log at CMakeLists.txt:19 (find_package):
  find_package considered the following paths for gRPC.cmake

    /usr/share/cmake/Modules/FindgRPC.cmake

  The file was not found.

    /home/kmh/vcpkg/packages/grpc_x64-linux/share/grpc/gRPCConfig.cmake

CMake Debug Log at CMakeLists.txt:21 (find_package):
  <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH].

    none

  CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
  [CMAKE_FIND_USE_CMAKE_PATH].

    none

  Env variable OpenSSL_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
  [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  Paths specified by the find_package HINTS option.

    none

  Standard system environment variables
  [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].

    /usr/local/python
    /usr/local/openssl
    /home/kmh
    /usr/local
    /usr
    /

  CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].

    none

  CMake variables defined in the Platform file
  [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].

    /usr/X11R6
    /usr/pkg
    /opt

  CMake System Package Registry
  [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].

    none

  Paths specified by the find_package PATHS option.

    /home/kmh/test-otel

  find_package considered the following locations for the Config module:

    /usr/local/python/OpenSSLConfig.cmake
    /usr/local/python/openssl-config.cmake
    /usr/local/openssl/OpenSSLConfig.cmake
    /usr/local/openssl/openssl-config.cmake
    /usr/local/openssl/openssl.cnf.dist/OpenSSLConfig.cmake
    /usr/local/openssl/openssl.cnf.dist/openssl-config.cmake
    /usr/local/openssl/openssl.cnf/OpenSSLConfig.cmake
    /usr/local/openssl/openssl.cnf/openssl-config.cmake
    /home/kmh/OpenSSLConfig.cmake
    /home/kmh/openssl-config.cmake
    /usr/local/OpenSSLConfig.cmake
    /usr/local/openssl-config.cmake
    /usr/local/openssl/OpenSSLConfig.cmake
    /usr/local/openssl/openssl-config.cmake
    /usr/OpenSSLConfig.cmake
    /usr/openssl-config.cmake
    /OpenSSLConfig.cmake
    /openssl-config.cmake
    /opt/OpenSSLConfig.cmake
    /opt/openssl-config.cmake
    /home/kmh/test-otel/OpenSSLConfig.cmake
    /home/kmh/test-otel/openssl-config.cmake

  The file was not found.

CMake Error at CMakeLists.txt:21 (find_package):
  Could not find a package configuration file provided by "OpenSSL" with any
  of the following names:

    OpenSSLConfig.cmake
    openssl-config.cmake

  Add the installation prefix of "OpenSSL" to CMAKE_PREFIX_PATH or set
  "OpenSSL_DIR" to a directory containing one of the above files.  If
  "OpenSSL" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!
See also "/home/kmh/test-otel/CMakeFiles/CMakeOutput.log".
See also "/home/kmh/test-otel/CMakeFiles/CMakeError.log".
github-actions[bot] commented 1 year ago

This issue was marked as stale due to lack of activity.

github-actions[bot] commented 1 year ago

This issue was marked as stale due to lack of activity.

owent commented 1 year ago

The packages needed depdend how you compile otel-cpp. If you compile otel-cpp without openssl, find_package(OpenSSL) is not required. I think maybe it's better to install the missing packages if you use vcpkg to manage packages.

github-actions[bot] commented 10 months ago

This issue was marked as stale due to lack of activity.

nefarius commented 4 months ago

Facing same issue since I vcpkg updated to 1.16.x, unchanged code worked fine on 1.14.x and earlier.

owent commented 3 months ago

@TheOxFromOutOfTheBox In my understanding, You may need include("${CMAKE_TOOLCHAIN_FILE}") if you set CMAKE_TOOLCHAIN_FILE after project(otel-test). Setting this variable does nothing after toolchains is already detected.

The better way to use toolchain file is use -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake in commandline or you can try to set it before project sentence.

github-actions[bot] commented 1 month ago

This issue was marked as stale due to lack of activity.