Skip to content

Failed to build opentelemetry-cpp with OTLP HTTP exporter #1132

@thangdinh1298

Description

@thangdinh1298

Describe your environment
OS: Debian 10
Release version: opentelemetry-cpp v1.1.0
Compiler: g++ 8.3.0

Steps to reproduce

cmake ../ -DWITH_OTLP=ON -DWITH_OTLP_HTTP=ON -DBUILD_TESTING=OFF
make -j

What is the expected behavior?
Builds successfully

What is the actual behavior?
The build failed with the following error

opentelemetry-cpp/exporters/otlp/src/otlp_http_client.cc:292:40: error: cannot convert 'const string' {aka 'const std::__cxx11::basic_string'} to 'const unsigned char*'
google::protobuf::Base64Escape(bytes, &base64_value);

opentelemetry-cpp/exporters/otlp/src/otlp_http_client.cc:31:58: note: initializing argument 1 of 'int google::protobuf::Base64Escape(const unsigned char*, int, char*, int)'
LIBPROTOBUF_EXPORT int Base64Escape(const unsigned char *src, int slen, char *dest, int szdest);

Aditional Context
It seems that the function Base64Escape was being called with the incorrect set of arguments. It was called with bytes, which is an std::string instead of a const unsigned char *.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions