Replies: 3 comments 6 replies
-
@gabguy - Building DLL is not supported on Windows. You would have to build a static library. Does it answer your question? |
Beta Was this translation helpful? Give feedback.
-
I was able to compile it through vcpkg, as for DLL, I did something nasty, after the static libs were created, I did a script that dumps all symbols and the one with opentelemetry in them (~) were placed in .def file, then relinked with it. It exported ~3000 symbols, but it worked. Had to remove some symbols by hand. Ideally though there should be OPENTELEMETRY_API for each class (I hope). |
Beta Was this translation helpful? Give feedback.
-
Hi all - I have an (experimental) fork for compiling on windows as dll/shared libs here on my github account. The only real issue with merging this is that it requires that the api is a compiled library - not a header-only library as it is today. There are workarounds to make it possible to compile otel-cpp as either header-only or compiled library, but it places a large burden on the maintainers of otel-cpp. |
Beta Was this translation helpful? Give feedback.
-
Hey, I’ve tried to compile OpenTelemetry C++ on Windows in order to integrate it with my C++ application.
I used this command:
cmake -DBUILD_SHARED_LIBS=ON -DWITH_OTLP=ON -DWITH_PROMETHEUS=ON -DBUILD_TESTING=ON -DWITH_EXAMPLES=ON -DWITH_JAEGER=ON ..
and got this error:
Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/Users/shlomo/Desktop/source/opentelemetry-cpp/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe cmTC_fe615.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64
CheckIncludeFile.c
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_fe615.dir\Debug" /Fd"cmTC_fe615.dir\Debug\vc142.pdb" /Gd /TC /errorReport:queue "C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c"
C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1,10): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\cmTC_fe615.vcxproj]
Performing C++ SOURCE FILE Test COMPILER_HAS_DEPRECATED_ATTR failed with the following output:
Change Dir: C:/Users/shlomo/Desktop/source/opentelemetry-cpp/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe cmTC_e614a.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64
src.cxx
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_HAS_DEPRECATED_ATTR /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_e614a.dir\Debug" /Fd"cmTC_e614a.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue /Zc:__cplusplus "C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\src.cxx"
C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\src.cxx(1,16): error C2065: 'deprecated': undeclared identifier [C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\cmTC_e614a.vcxproj]
C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\src.cxx(1,31): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\cmTC_e614a.vcxproj]
C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\src.cxx(1,37): error C2448: 'attribute': function-style initializer appears to be a function definition [C:\Users\shlomo\Desktop\source\opentelemetry-cpp\build\CMakeFiles\CMakeTmp\cmTC_e614a.vcxproj]
Source file was:
attribute((deprecated)) int somefunc() { return 0; }
int main() { return somefunc();}
Can anyone please help?
Beta Was this translation helpful? Give feedback.
All reactions