Comments (15)
This is now a problem in VS2022 17.8.0 which was released today.
from cpprestsdk.
ChatGPT response for how to apply _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
for all solutions in Visual Studio 17.8.4 that worked for me.
Using Property Sheets in Visual Studio is a good way to apply settings like preprocessor definitions across multiple projects. Here's a step-by-step guide on how to create and apply a Property Sheet for the _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
preprocessor definition:
Creating a Property Sheet
-
Open Visual Studio and a Project: Start by opening one of your projects in Visual Studio.
-
Open Property Manager: Go to
View
>Other Windows
>Property Manager
. This will open the Property Manager window, which lists all your projects and their respective property sheets. -
Add New Property Sheet:
- Right-click on one of your projects in the Property Manager and choose
Add New Property Sheet...
. - Give it a name, like
GlobalSuppressions.props
, and save it in a common location where it can be accessed by all projects.
- Right-click on one of your projects in the Property Manager and choose
-
Edit the Property Sheet:
- Once the property sheet is created, it will appear under the project in the Property Manager. Right-click on it and select
Properties
. - In the Property Pages dialog, navigate to
C/C++
>Preprocessor
. - Under
Preprocessor Definitions
, click on the dropdown and select<Edit...>
. - Add
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
to the list. Click OK.
- Once the property sheet is created, it will appear under the project in the Property Manager. Right-click on it and select
-
Save: Save the changes and close the property sheet properties.
Applying the Property Sheet to Other Projects
-
Open Other Projects: Open another project where you want to apply this property sheet.
-
Use Property Manager:
- Again, go to
View
>Other Windows
>Property Manager
. - Right-click on the project in the Property Manager.
- Again, go to
-
Add Existing Property Sheet:
- Choose
Add Existing Property Sheet...
. - Navigate to the location where you saved
GlobalSuppressions.props
and select it.
- Choose
-
Apply and Repeat: The property sheet is now applied to this project. Repeat this step for each project where you want to apply the preprocessor definition.
Notes
- Consistency: Ensure that all projects that need the preprocessor definition have the property sheet applied.
- Source Control: If you're using source control, remember to add the property sheet file to your repository.
- Updates: Any changes made to the property sheet will automatically apply to all projects that include it.
This approach centralizes certain settings, making them easier to manage across multiple projects. It's especially useful in larger solutions with many projects.
from cpprestsdk.
This is now a problem in VS2022 17.8.0 which was released today.
same happen with vs2022 17.8.3
from cpprestsdk.
These are the steps I followed and the solution worked for. I am doing a React Native for Windows project.
This is the key part, each solution that uses C++ needs _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
in Properties
> C/C++
> Preprocessor
> Preprocessor Definitions
in order to compile:
Example of how to get to properties on a solution:
Example of setting being applied:
I choose to do this via Property Sheets but you could also manually go through each solution.
from cpprestsdk.
I added GlobalSupressions.prop
to my ~/<PROJECT>/windows/<APPNAME>
directory
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions);_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING;</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
Then I added clicked Add Existing Property Sheet
to each C++ solution
and navigated to the path of my ~/<PROJECT>/windows/<APPNAME>/GlobalSupressions.prop
.
I did this for each solution and then it would compile both via the play button in Visual Studio and via npx react-native run-windows
I'm sure there is a better way to do this, but I am not a C++ developer and this was the first option that worked for me.
from cpprestsdk.
I'd like to copy the definition of checked_array_iterator
into cpprestsdk's header (with de-_Uglification), if we don't want to rely on GSL or C++20 (for span
).
from cpprestsdk.
Is there a path forward to getting this fix merged? If not, would a patch to silence the warning be welcomed in the vcpkg portfile for cpprestsdk? A number of projects I've worked on consume cpprestsdk from vcpkg. They treat warnings as errors and have had to silence the deprecation warning with the new compiler update.
from cpprestsdk.
For what it's worth, this is still an issue for us, and our current work around (for the poor souls unfortunate enough to have upgraded VS 2022 early), is to replace this (line 404 in containerstream.h):
std::copy(readBegin, readEnd, stdext::checked_array_iterator<_CharType*>(ptr, count));
To this:
std::span<_CharType> data_span(readBegin, readEnd);
std::copy(data_span.begin(), data_span.end(), ptr);
Remember to add include <span>
as well, and you might have to modify the second std::copy
below under the neighboring #else
.
from cpprestsdk.
Hey @OliverGlandberger , i have issue :
Build failed with message C:\Users\ssing\Documents\Mobile_faciligo\facilgo-sales-app\node_modules.fmt\fmt-8.0.0\include\fmt\format.h(341,51): error C4996: 'stdext::checked_array_iterator<T*>': warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory functions are non-Standard extensions and will be removed in the future. std::span (since C++20) and gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning. [C:\Users\ssing\Documents\Mobile_faciligo\facilgo-sales-app\node_modules\react-native-windows\fmt\fmt.vcxproj]. Check your build configuration.
Command failed. Re-run the command with --logging for more information.
is there any solution for this?
from cpprestsdk.
Hey @OliverGlandberger , where is containerstream.h located? In my project, this file does not exist in Android.
from cpprestsdk.
We are facing the same issue. A solution other than having to ignore the warning would be required.
from cpprestsdk.
Thanks @joshuayoes but this does not work..... when you open property manager, it says that there are no c/c++ projects and does not list my project in the property manager window so I can't click on it and add a property sheet. I believe this is because my project is react-native/javascript. Any ideas?
from cpprestsdk.
17.8.6
No official fix for it
jezz, Microsoft
from cpprestsdk.
Reproduced in 17.9.1
from cpprestsdk.
Same stuff in 17.9.6
from cpprestsdk.
Related Issues (20)
- http_exception must derive from std::runtime_error
- Is this project discontinued?
- Documentation Bug in CMake File
- Why do I get these errors when cross-compiling?
- EOF error
- Printing a json-array without sorting the keys
- How to set timeout for the socket connection HOT 1
- Periodic drop in throughput in inter-(linux N/W namespace) communications HOT 1
- Static version of the nugget for Visual Studio Express 2013 for Windows Desktop
- The web_proxy doesn't work when set proxy with uri
- Charset support gbk...
- utility::details::str_iless(str1, str2);
- [MSVC] websocketsclient_test failed due to CHECK_EQUAL(ret_msg.length(), body_str.length()) where ret_msg.length()=32 and body_str.length()=5 HOT 1
- ../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found HOT 2
- async http client post/get request demo?
- nable to add both a file stream and key-value pairs to the body of the request simultaneously
- error: building cpprestsdk:x64-linux failed with: BUILD_FAILED HOT 1
- [http_client] CN checking against caller-specified Host header doesn't strip a port number
- using cpprest and segmentation fault on ubuntu 22.04 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpprestsdk.