LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   iostream.h: g++ 3.4.6 vs. g++ 4.7.1 (https://www.linuxquestions.org/questions/linux-software-2/iostream-h-g-3-4-6-vs-g-4-7-1-a-4175485492/)

rdx 11-22-2013 05:08 AM

iostream.h: g++ 3.4.6 vs. g++ 4.7.1
 
I just installed Slackware64 vers 14 on my new machine and I copied over a bunch of programs I've written over a few decades from another machine running Slackware vers 11. I was not surprised to discover the programs don't run because the link libraries are different but I was surprised to find many of the programs won't compile due to a "missing" <iostream> or <iostream.h>.

Am I doing something wrong or has the language changed that much in seven years?

rtmistler 11-22-2013 07:38 AM

Yes, it is now just iostream

That's part of the ISO C++ standard, derived I think back in 1998. There was obviously some number of years where it continued to be used; however I'm sure now it has been deprecated fully.

2012 Draft Standard

I'm sure there may be a more recent copy, this is just one of the first search results that popped up.

rdx 11-23-2013 05:12 AM

So you're saying they changed the ***** language? How the *** are we to write and maintain code if they move the **** goal posts? That makes me mad. SO can anyone tell me what has replaced these streams? Or is there a legacy flag that can be set? I loved C when K&R did it but MicroSofting it so it goes obsolete every year stinks.

rdx 11-23-2013 06:30 AM

Okay, the problem wasn't that <iostream> was lost, it was that i needed "using namespace std;" which was not required by compilers when the code was written. I still hate having to go back and update hundreds of programs I've written over the years but I guess it can't be helped. Thnx rtmisler for your reply. I looked at the Standard you mentioned but found it difficult to read.

bknapek 11-26-2013 02:15 AM

Exactly. I was also suprised by this recently.
The "namespace" was introduced into the standard back in 1995, but went unnoticed for years, until it became mandatory.


All times are GMT -5. The time now is 11:52 PM.