Finding where ciso646 is included? - c++

I'm coming back to an old project (Visual Studio 2022, C++20), and when I try to compile it, I get the warning
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\ciso646(15,47): error C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning.
Is there an easy way find the file which is including this header? I'm including several external (source) libraries.
If I search "Entire solution" in VS for "ciso646", I find nothing.

Related

How can I resolve C2733 Linking Error in Visual Studio

I've been trying to compile the Adaptive Communications Environment (ACE) project in MS Visual Studio 17 2022, but have been getting a slew of related linking errors.
Below is an example:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\cstdlib(23,41): error C2733: 'abs': you cannot overload a function with 'extern "C"' linkage
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(464,38): message : see declaration of 'abs'
This issue is obviously not originating in the ACE code, but in the code bundled in with the build tools.
My guess is there is a clash between MSVC 14.33.31629 and Windows Kit 10.
Does any one have any suggestions on a fix? Is there a compiler or pre-processor flag I can use to mitigate this? Should I use different versions of the MS Build Tool or Windows Kit?
I resolved this by upgrading my Windows SDK to version 10.0.20348.0.

Compiler accuses "Error C2065: 'ENOTEMPTY': undeclared identifier". VS looks for its definition in WinSock.h instead of errno.h

Working under Visual Studio 2010, I've developed a library to p/Invoke some stuff from a third-party native C++ dll. I haven't touched the C++ project in this solution for a while (even though I come back to the C# project every now and then) and everything was working fine. This morning I had to add a new method to the C++ project and I started getting the following error:
Error 2 error C2065: 'ENOTEMPTY' : undeclared identifier C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error 40 1 xxxNativeDll
("xxxNativeDll" is my C++ wrapper to the third-party .dll)
I'm no expert in C++ but I poked around the web a bit and the closest clue I could find is in this post: https://social.msdn.microsoft.com/Forums/vstudio/en-US/0abac212-6bde-40a0-81ce-9e2b0ddaa106/conversion-error-while-converting-project-from-msvs-2008-to-msvs-2010?forum=vcgeneral
Basically someone was getting the undeclared identifier error to all the macros in system_error and in the answer, he was told these macros are defined in errno.h. Well, here are my includes in the build output, from system_error up to the error itself:
2> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error
2> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cerrno
2> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h
2> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error(40): error C2065: 'ENOTEMPTY' : undeclared identifier
Just to be sure, I highlighted ENOTEMPTY, hit F12 (go to definition) and alas! I was redirected to WinSock.h in the C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include folder. Surprisingly enough, only ENOTEMPTY redirects to this file, all other macros in system_error redirect to errno.h. I'm pretty sure it has something to do with the fact that I've installed WinDDK 7 a while back, but since I didn't need to rebuild the C++ project in this solution in a long time, there have been no errors since then.
So, long story short, VS "thinks" ENOTEMPTY from system_error is defined in WinSock.h while it should look for its definition in errno.h. Like I said, I'm no C++ pro, so how can I fix it? Please, I don't wanna add WinSock.h to my includes but I want VS to look for ENOTEMPTY in the correct file.
As pointed out in the comments, it had nothing to do with WinSock.h but rather a faulty errno.h file. I was gonna delete this question but decided to let it live as there's not enough information on these kind of problems out there.

Ancient .IDE project having errors in Visual Studio 2015 system files

I'm resurrecting an ancient project, one developed when the Visual Studio project type was "IDE". I've got everything building, except for cmath errors like:
'acoshl': ambiguous call to overloaded function
in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath.
I have no references to cmath or math.h in my code, and nothing tells me why there is a conflict with functions never referenced. Obviously, I don't want to edit system files. :)

Exprtk parser not working on VS 2015?

I am trying to use the parser from this site:
http://www.partow.net/programming/exprtk/
on VS 2015. Unfortunately, I get the following error while compiling exprtk_simple_example_01 (one of the example files included in the download with the parser):
Severity Code Description Project File Line Suppression State
Error C4996 'std::_Copy_impl': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators' TEST
c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility 2229
Why is that? Is this parser not compatible with VS 2015?
THE SOLUTION IS:
In solution explorer, right click the project, select "properties". The project property page will open. Expand the ">C/C++" entry in the tree on the left and select "Preprocessor" under that. The top entry in the right pane should be "Preprocessor Definitions". In that edit box, add _SCL_SECURE_NO_WARNINGS, separating it from the other entries with a ;
Then set the linker flag /bigobj!

Visual Studio 2012 C++ compile error with Boost Signal2

I am using Visual Studio 2012 Ultimate with the following Boost Signals2 code: at https://github.com/cfobel/boost_signals2/blob/master/hello_world_0.cpp
It generates the following error:
c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory(348): error C4996: 'std::_Uninitialized_copy0': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory(333) : see declaration of 'std::_Uninitialized_copy0'
1> c:\libraries\boost_1_52_0\boost\signals2\detail\auto_buffer.hpp(192) : see reference to function template instantiation '_FwdIt std::uninitialized_copy<I,boost::variant<T0_,T1>*>(_InIt,_InIt,_FwdIt)' being compiled
Is this code not compatible for Visual Studio 2012 C++? Is it still safe to use? Lastly, how do I make the changes as suggested?
Thanks
C4996 is a warning about using a function that has been marked deprecated. Since you're seeing it as an error, maybe you have the Treat Warning as Error (/WX) option enabled?
The way to disable this one is described in the error message itself. Add the _SCL_SECURE_NO_WARNINGS symbol to the project's preprocessor definitions.