Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zipkin example is not compiled successfully due to missing header file error #2068

Closed
cngzhnp opened this issue Mar 23, 2023 · 3 comments · Fixed by #2069
Closed

Zipkin example is not compiled successfully due to missing header file error #2068

cngzhnp opened this issue Mar 23, 2023 · 3 comments · Fixed by #2069
Labels
bug Something isn't working

Comments

@cngzhnp
Copy link
Contributor

cngzhnp commented Mar 23, 2023

Describe your environment
When "WITH_ZIPKIN" option is ON while compile Zipkin example, compiler complains about that "opentelemetry/exporters/zipkin/zipkin_exporter_factory.h" file not found.

Steps to reproduce
set(WITH_EXAMPLES ON)
set(WITH_ZIPKIN ON)

What is the expected behavior?
Zipkin example should be compiled successfully when its example is enabled.

What is the actual behavior?
Compiler error due to not found header file.

Additional context
Zipkin folder inside of "exporters" folder there is a CMakefile of this component. In this CMakefile, target_include_directories was not defined. In my opinion, this is a problem that needs to be fixed.

@cngzhnp cngzhnp added the bug Something isn't working label Mar 23, 2023
@cngzhnp cngzhnp changed the title Zipkin example does not compile due to missing header file error Zipkin example is not compiled successfully due to missing header file error Mar 23, 2023
@marcalff
Copy link
Member

This is surprising, because in the [CI] builds, the zipkin exporter example builds properly.

Below is a log taken from the clang 14 (maintainer mode) build.

Scanning dependencies of target example_zipkin
make[2]: Leaving directory '/home/runner/build'
make[2]: Entering directory '/home/runner/build'
[ 96%] Building CXX object examples/zipkin/CMakeFiles/example_zipkin.dir/main.cc.o
[ 96%] Linking CXX executable example_zipkin
make[2]: Leaving directory '/home/runner/build'
[ 96%] Built target example_zipkin

Please clarify how the build is done (with the cmake commands used), and paste the compiler error message seen.

@cngzhnp
Copy link
Contributor Author

cngzhnp commented Mar 23, 2023

Current CMake version is 3.25.1
GNU Compiler version is 12.2.0

In our project, OTLP as a third-party library (v1.8.3) that will be compiled & linked into our application. In our CMakeLists.txt file, OTLP options are configued like this:

set(WITH_STL OFF)
set(WITH_EXAMPLES ON)
set(WITH_ZIPKIN ON)
set(WITH_OTLP ON)
set(WITH_OTLP_GRPC ON)
set(USE_NLOHMANN_JSON OFF)
set(BUILD_TESTING OFF)

Afterwards, when we compile the examples, getting this error during compilation:

/observability/3rdParty/opentelemetry-cpp/examples/zipkin/main.cc:4:10: fatal error: opentelemetry/exporters/zipkin/zipkin_exporter_factory.h: No such file or directory
    4 | #include "opentelemetry/exporters/zipkin/zipkin_exporter_factory.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

@marcalff
Copy link
Member

Thanks for the details. Approved the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants