Jump to content
  • Advertisement
Sign in to follow this  
Drakilor

fstream.h out of date?

This topic is 4844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When i try to compile i get the following error: 32:2 DEV-CPP\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 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. Must i take it away by using -Wno-deprecated? And how do i use it? I don´t even know what it is.

Share this post


Link to post
Share on other sites
Advertisement
Standard C++ does not recognize any headers with a .h extension as being standard. Standard headers do not have an extension, and the incorporated C headers start with a c.

In your case it would be: <fstream>. The Standard library is also in the std namespace.

Share this post


Link to post
Share on other sites
in C++ the .h version of the headers are deprecated, use the ones without a .h like this:
#include <fstream>
#include <iostream>
// etc...

you can also add
using namespace std;
if you don't want to always type
std::fstream f; //etc...


hope that helps !
Matt


Share this post


Link to post
Share on other sites
Those two bytes (.h) messed up a bit. The errors dissappeared along with them. Thank you for your help.

BTW, why do i need to change "class CDerived: CBase {..." into "class CDerived {...", compile, change back and compile again sometimes(!) to avoid getting the error: expected class name before '{'.?

Share this post


Link to post
Share on other sites
well for one you should be specifying the type of inheritance your using, ie:

CDerived : public CBase { ...

Altho without seeing the actually source it's hard to say what the actual problem is.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!