Where is this backward_warning.h #warning coming from?
Without looking through every single source file in my XCode project, is there a way to find out which #include is triggering the following warning?
#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 126.96.36.199 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
Clicking on the error in XCode just opens the backward_warning.h file, which is totally useless.
I know what the warning means, I know how to fix it (when I see the file in question and can look at its #includes)… but I just don’t know how to find the file causing the error!
- Working with C APIs from Swift
- How to add C++ files in iphone project
- -fvisibility=hidden not passed by compiler for Debug builds
- Using C functions in Swift that take functions as arguments
- ZXing Library: Errors in iOS: private field 'cached_y_' is not used
- How can I 'break away' from Cocoa and develop Mac OpenGL applications in C/C++?
3 Solutions Collect From Internet About “Where is this backward_warning.h #warning coming from?”
-H option to GCC – that will list the header files that are being included (along with a nesting indication so you can see what file is including which header).
-H the error will be placed in the output stream clearly showing how the compiler got to
For example, when I include
hash_map, I’d see:
mikeb@ubuntu:~$ g++ -H -c test.cpp . /usr/include/c++/4.4/backward/hash_map .. /usr/include/c++/4.4/backward/backward_warning.h In file included from /usr/include/c++/4.4/backward/hash_map:60, from test.cpp:3: /usr/include/c++/4.4/backward/backward_warning.h:28: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. ... a bunch of snipped output ...
As an aside,
/showIncludes performs the same function in MSVC.
As you stated, the file
contains the text you quote. The headers which include
Therefore, the code you are compiling must be including a header such as:
instead of the preferred:
And the compiler is getting fussy about it. The fix is to find the code which includes the pre-standard header and update it to use the standard header.
(You get similar warnings about deprecated functions if you compile
git – the functions are the SHA1 functions from OpenSSL. It is a nuisance, to be polite about it.)
You have an old style header somewhere.
something like this
#include <iostream.h> //instead of <iostream> #include <stdlib.h> //instead of <cstdlib> #include <stdio.h> //instead of <cstdio>
if it is included from a library then I think you are SOL, I personally wouldn’t rummage through a library to get it to work you will have to up date them to use namespaces. and other such.
- Linking libuv library in XCode
- FFMPEG iOS 7 Library
- How to share image in instagram?Swift
- identifierForVendor changes on reinstall
- How to fire uibarbuttonitem click event programmatically
- iOS develop. How to extend UIScrollView's scroll event responding area?
- Possible to generate a list of connected bluetooth devices for iOS?
- Can receive mail directly from mail server in custom iPhone app?
- Google Analytics Library IOS
- What exactly does `: class` do in a protocol declaration?
- Swift – How to get indexes of filtered items of array
- MvvMCross navigate back multiple viewmodels / truncate navigation stack
- Create a thumbnail or image of an AVPlayer at current time
- Using UIImagePickerController to get image — how to know whether to save PNG or JPEG?
- Button in the middle of navigationBar