Message-ID: <20030205153840.3916.qmail@web13008.mail.yahoo.com> Date: Wed, 5 Feb 2003 07:38:40 -0800 (PST) From: Thomas Tutone Subject: Re: new install question for 3.21 To: djgpp AT delorie DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Reply-To: djgpp AT delorie DOT com "Drew" wrote: > I just upgraded from the old 2.72 version of DJGPP > to the newest version 3.21. Wow, that was an old version you had. > All my exisiting C and C++ programs compile and run > fine but I get an > information message that I never got before when I > compile. > > The message is: > > In file included from > c:/djgpp/lang/cxx/3.21/backward/iostream.h:31, > from maketree.cpp:6: > c:/djgpp/lang/cxx/3.21/backward/ > backward_warning.h:32: > 2: warning: > #warning This file includes at least one deprecated > or antiquated > header. Please consider usin > g one of the 32 headers found in section 17.4.1.2 > of the C++ standard. > Examples > include substituting the header for the > header for C++ > includes, or stream> instead of the deprecated header > . To disable > this warning > use -Wno-deprecated. > The program still runs fine....I'm just not sure > how to correct this > message. If I just say #include , the > compile generates > lots of errors as it doesn't find cout and the > functions. > > Should I just use the command flags to suppress it > or what? > Get an up-to-date C++ textbook, which will explain the difference between and . Briefly, in 1998, the C++ standard was adopted. Among other things, it introduced the concept of namespaces. All standard library functions, objects, and classes are now in namespace std. This means that what used to be known as cout is now actually std::cout (which is why you got those error messages). It is defined in . The headers your old code uses, like , do not conform to the standard. Since version 3.0, GCC (and therefore DJGPP) have conformed to the standard in this respect, but have kept in the old-style headers as well so that old code would not be broken. If you are going to be modifying the code and using other parts of the standard library, the best course probably is for you to bring the code up to date. I would also do that for any new code you write, so that your new code conforms to the standard. But for your existing code, you have a couple choices. Quick and dirty solution: You can change to the proper headers (like ), and at the beginning of each .cpp file add: using namespace std; But, if the code works OK as is using the deprecated headers (like ), and you're not modifying the code, you may want to just leave it as is rather than change it. The standard headers can differ from the old-style headers in obscure ways, and if it ain't broke, perhaps better not to try to fix it. In that case, you may as well suppress the warning using the command line option. But I wouldn't get in the habit of doing so. For any new code, compile with all warnings on: gxx -W -Wall -pedantic -o foo.exe foo.cpp Best regards, Tom __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com