Thread: [Dev-C++] Bug in dev-c++ header files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Mohamed I. <ia...@jo...> - 2003-08-27 18:36:07
|
Hi...
Try to compile the following code using Dev-C++ 4.9.8.0.
#include <fstream.h>
int main()
{}
You will receive error!!!!!
Mohammed
|
|
From: P.D. v. Z. <pa...@my...> - 2003-08-27 19:22:12
|
And in what way is this a bug in the MingW (NOT Dev-C++, Dev-C++ is
_NOT_ a compiler, only an IDE) headers?
The C++ standard library files are extensionless, using the .h variant
is deprecated. The compiler should tell you this, as a warning, not an
error. The proper way to write what you had is:
#include <fstream> // Note, NO extension
int main()
{
// do something with the facilities provided by fstream, for
instance:
std::ofstream out("blah.txt");
out << "Howdy" << endl;
return 0;
}
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Mohamed
Iqbal
Sent: Wednesday, August 27, 2003 8:35 PM
To: Dev-Cpp-Users
Subject: [Dev-C++] Bug in dev-c++ header files
Hi...
Try to compile the following code using Dev-C++ 4.9.8.0.
#include <fstream.h>
int main()
{}
You will receive error!!!!!
Mohammed
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Michal M. <mol...@se...> - 2003-08-27 19:58:13
|
Mohamed Iqbal wrote:
> Hi...
>
> Try to compile the following code using Dev-C++ 4.9.8.0.
>
> #include <fstream.h>
> int main()
> {}
>
> You will receive error!!!!!
under 4.9.8.1 I don't see any error (only one warning)
|
|
From: <san...@ya...> - 2003-08-27 20:07:20
|
Hi!
Sorry to say this, but the problem is not with the
header, but with your program : such a syntax doesn't
comply with ansi c++ anymore.
I'm not a c++ guru, but I think you should write
something like :
#include <fstream>
using namespace std;
int main()
{}
Simply removing the ".h" from the #include works.
By the way, I'm new to the list, so Hi! Everyone...
Sandy/Moonlight
--- Mohamed Iqbal <ia...@jo...> a écrit :
> Hi...
>
> Try to compile the following code using Dev-C++
> 4.9.8.0.
>
> #include <fstream.h>
> int main()
> {}
>
> You will receive error!!!!!
>
> Mohammed
>
>
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
|
|
From:
<ten...@ne...> - 2003-08-28 16:26:24
|
Dev-Cpp 4.9.8.x, if I'm not wrong uses MinGW 2.0.0, based on GCC 3.0
(I'm not sure because I have the editor and the compiler downloaded
separately). In it fstream.h and any c++ header with extension is
considered obsolete, so it is in ./include/c++/3.2/backward; which is a
directory which seems to not be in the default search path, so you have
to add it with the -I compiler option and, if you don't pass the
-Wnodeprecated option it will warn about the use of a deprecated header.
You should use the headers without extension, but don't forget they use
namespaces, so you'll have to either add the line using namespace std;
before your code (which breaks the object of namespace), or various
lines saying using std::whatever in that namespace you use, e.g.,
std::cout, std::endl, etc so you can type simply cout or endl, etc, or
you'll have to qualify all those standard functions and variables and
classes with the std:: prefix, saying std::cout <<, std::cin >>,
std::endl, etc.
Mohamed Iqbal wrote:
>Hi...
>
>Try to compile the following code using Dev-C++ 4.9.8.0.
>
>#include <fstream.h>
>int main()
>{}
>
>You will receive error!!!!!
>
>Mohammed
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
|
|
From: Mohamed I. <ia...@jo...> - 2003-08-28 21:28:06
|
Sorry for posting this. In fact, I know that DEV-C++ is just and IDE (I guess more than this) to the MingW compiler. I know also that the header files come with the compiler. This is a typo I made because I was hurry and tired. All my applications are written in Standard C++. I don't use the old C header files unless it is needed. The problem arises from a simple application I wrote ten years ago using Borland C++. I tried to compile it using more than one compiler and all produced no error and no warning. But on Dev-C++ I received an error message from the compiler. Mohammed |
|
From: P.D. v. Z. <pa...@my...> - 2003-08-28 21:48:52
|
Then you could interpret this in two ways.... 1) MingW or GCC has a bug in one of its header files 2) All the other compilers accept non-standard code, where GCC is pretty strict about this. And I'm pretty sure it's the second... fstream.h is non-standard, no matter how you look at it. If you could tell us what error you get, it'd help things along a lot. A full compile log would be even better (all of the text you see in the "Compile Log" tab). I think it's this 'error' (warning) you get: warning: #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 <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. And this warning in itself indicates exactly what the problem is. Paul -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Mohamed Iqbal Sent: Thursday, August 28, 2003 11:26 PM To: Dev-Cpp-Users Subject: Re: [Dev-C++] Bug in dev-c++ header files Sorry for posting this. In fact, I know that DEV-C++ is just and IDE (I guess more than this) to the MingW compiler. I know also that the header files come with the compiler. This is a typo I made because I was hurry and tired. All my applications are written in Standard C++. I don't use the old C header files unless it is needed. The problem arises from a simple application I wrote ten years ago using Borland C++. I tried to compile it using more than one compiler and all produced no error and no warning. But on Dev-C++ I received an error message from the compiler. Mohammed ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <iv...@em...> - 2003-08-28 21:57:36
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Mohamed Iqbal > Sent: Friday, August 29, 2003 12:26 AM > To: Dev-Cpp-Users > Subject: Re: [Dev-C++] Bug in dev-c++ header files > > > Sorry for posting this. In fact, I know that DEV-C++ is just > and IDE (I > guess more than this) to the MingW compiler. I know also that > the header > files come with the compiler. This is a typo I made because I > was hurry and > tired. > > All my applications are written in Standard C++. I don't use the old C > header files unless it is needed. > > The problem arises from a simple application I wrote ten > years ago using > Borland C++. I tried to compile it using more than one > compiler and all > produced no error and no warning. But on Dev-C++ I received > an error message > from the compiler. So as expected, non standard compliant code can't be considered portable. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Tony M. <to...@br...> - 2003-08-29 22:20:02
|
r c |