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

dd-opentracing-cpp Win x64 Error opentracing dependency missing from CMakeLists.txt - LNK2019 unresolved external symbol propagation_error_category #268

Open
buzz3791 opened this issue Jul 20, 2023 · 4 comments

Comments

@buzz3791
Copy link

I’ve modified our C++ application to use DataDog.
I’ve added:

  1. the following include:
#include <opentracing/dynamic_load.h>
  1. the DataDog include folder:
dd-opentracing-cpp\.build\vcpkg_installed\x64-windows\include
  1. the DataDog link library folder:
dd-opentracing-cpp\.build\RelWithDebInfo
  1. the DataDog link library:
    dd_opentracing.lib
    After the changes above, when building our C++ application with Visual Studio, the build is failing at link time with these DataDog related errors:
Error        LNK2019        unresolved external symbol "__declspec(dllimport) class std::error_category const & __cdecl opentracing::v3::propagation_error_category(void)" (__imp_?propagation_error_category@v3@opentracing@@YAAEBVerror_category@std@@XZ) referenced in function "void __cdecl opentracing::v3::`dynamic initializer for 'invalid_carrier_error''(void)" (??__Einvalid_carrier_error@v3@opentracing@@YAXXZ)        someapp        C:\dev\mvtrunk\someapp\someapp\someapp.obj

Error LNK2019 unresolved external symbol "__declspec(dllimport) class std::error_category const & __cdecl opentracing::v3::tracer_factory_error_category(void)" (__imp_?tracer_factory_error_category@v3@opentracing@@YAAEBVerror_category@std@@XZ) referenced in function "void __cdecl opentracing::v3::`dynamic initializer for 'configuration_parse_error''(void)" (??__Econfiguration_parse_error@v3@opentracing@@YAXXZ) someapp C:\dev\mvtrunk\someapp\someapp\someapp.obj
 
Error  LNK2019 unresolved external symbol "__declspec(dllimport) class std::error_category const & __cdecl opentracing::v3::dynamic_load_error_category(void)" (__imp_?dynamic_load_error_category@v3@opentracing@@YAAEBVerror_category@std@@XZ) referenced in function "void __cdecl opentracing::v3::`dynamic initializer for 'dynamic_load_failure_error''(void)" (??__Edynamic_load_failure_error@v3@opentracing@@YAXXZ) someapp C:\dev\mvtrunk\someapp\someapp\someapp.obj
@buzz3791
Copy link
Author

buzz3791 commented Jul 21, 2023

@dgoffredo Any ideas on why this issue is occuring? As far as I can tell, there are no DataDog .h nor .cpp files that are providing definitions of these *_error_category symbols.

@dgoffredo
Copy link
Contributor

I haven't done a build on Windows, but I think that you will need opentracing-cpp's library in addition to dd-opentracing-cpp's.

The idea is that opentracing-cpp is a library that defines some interfaces (abstract classes), vocabulary types (e.g. errors, variants), and utilities (such as the plugin loader). A plugin is then another library, like dd-opentracing-cpp, that implements the interfaces and provides a hook for the plugin loader to load.

Even if you're not using the plugin loader, you will need both libraries in order to build an application using dd-opentracing-cpp.

For some non-Windows examples, see compiled-in or dynamic-loading. As part of both docker image setups, they call scripts/install_dependencies.sh, which installs the opentracing-cpp library.

@raulbojalil
Copy link

@buzz3791 Were you able to fix this issue? I'm having the same issue right now. I'm including the opentracing-cpp library as suggested by dgoffredo, but I'm still getting the error.

@dgoffredo
Copy link
Contributor

Hi, @raulbojalil.

If @buzz3791 didn't find a solution that you can use, then please open up a Datadog Support ticket here. It will likely get escalated to my team, and then we can spend some time on Windows.

Note that dd-opentracing-cpp is no longer under active development. If you have the option of using a non-OpenTracing solution, then consider dd-trace-cpp instead.

If you want another vendor-agnostic solution, then you can look into opentelemetry-cpp. The Datadog Agent can act as an OTLP collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants