compiling from the command line/ ass1.c:1:22: iostream.h: No…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bart Garst
Date:  
Old-Topics: compiling from the command line/ ass1.c:1:22: iostream.h: No such file or directory
Subject: compiling from the command line/ ass1.c:1:22: iostream.h: No such fileor directory
gcc is the 'C' compiler. g++ is 'C++'.

Newer versions of g++ (I think >3.0) complain when you attempt to compile
the older 'C' style headers (iostream.h).

Change your #include statements to use the newer style and add a namespace
declaration.
Ex:

#include <iostream> // was iostream.h
#include <cstdlib> // was stdlib.h
using namespace std;

Now your code should compile without complaint.

If this is more than you can/want to do. Try using the Wno-deprecated
compiler option

`g++ -Wno-deprecated -c codefile.cpp`


If this still doesn't work there's something else wrong. Post the command
and options you're using to compile.

Bart

>
> Howdy all. I am trying to figure out how to compile from the
> command line and
> have run into some issues.
>
> as1.c:1:22: iostream.h: No such file or directory
>
> Any suggestions on how to get the gcc to recognive iostream.h
> whereever it may
> be hiding?
>
> -------------------------
> Robert James Wultsch III
>
> sheepsleep7 (AIM)
> (480)951-3169 (Home)
> (602)692-7564 (Cell)
> 6900 East Gold Dust #107
> Scottsdale, Arizona 85253, USA
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.fsf.org/philosophy/no-word-attachments.html
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>