Steps to Reproduce
-
Follow this article to integrate vcpkg with MSBuild/VisualStudio.
Tutorial: Install and use packages with MSBuild in Visual Studio
https://learn.microsoft.com/en-us/vcpkg/get_started/get-started-msbuild
.\vcpkg.exe integrate install
-
Create a C++ console application in Visual Studio 2022.
-
In Visual Studio, open Tools → Command Line → Developer Command Prompt.
-
Run:
vcpkg new --application
vcpkg add port opentelemetry-cpp[geneva]
-
In the project Property Pages, set: vcpkg → Use Vcpkg Manifest = Yes
-
Include the following header in your .cpp file:
#include "opentelemetry/logs/provider.h"
-
Build the project.
Expected Result
The project builds successfully with no errors.
Actual Result
The build fails with error C4996 due to deprecated symbols:
opentelemetry::v1::logs::EventLogger was declared deprecated
opentelemetry::v1::logs::EventLogger::~EventLogger was declared deprecated
opentelemetry::v1::logs::EventLoggerProvider was declared deprecated
opentelemetry::v1::logs::EventLoggerProvider::~EventLoggerProvider was declared deprecated
opentelemetry::v1::logs::Provider::GetEventProvider was declared deprecated
Additional Notes
This header is included because its APIs are required to set the Geneva TracerProvider as the global default, specifically to call:
GetLoggerProvider()
SetLoggerProvider()
Here is my testing project for this issue: https://github.com/lukeina2z/playground/tree/main/cpp/LogProviderWarning
Steps to Reproduce
Follow this article to integrate vcpkg with MSBuild/VisualStudio.
Tutorial: Install and use packages with MSBuild in Visual Studio
https://learn.microsoft.com/en-us/vcpkg/get_started/get-started-msbuild
.\vcpkg.exe integrate installCreate a C++ console application in Visual Studio 2022.
In Visual Studio, open Tools → Command Line → Developer Command Prompt.
Run:
In the project Property Pages, set: vcpkg → Use Vcpkg Manifest = Yes
Include the following header in your .cpp file:
Build the project.
Expected Result
The project builds successfully with no errors.
Actual Result
The build fails with error C4996 due to deprecated symbols:
Additional Notes
This header is included because its APIs are required to set the Geneva
TracerProvideras the global default, specifically to call:GetLoggerProvider()
SetLoggerProvider()
Here is my testing project for this issue: https://github.com/lukeina2z/playground/tree/main/cpp/LogProviderWarning