Discussion:
can't include iostream.h
MaaSTaaR
2006-04-13 16:41:39 UTC
Permalink
Hello ...

i am using Ubuntu Linux , i tried to use GCC to compile some C/C++ codes ,
but the first problem showed for me is "t.c:1:22: error: iostream.h: No such
file or directory" and when i do g++ test1.c it's show for me this problem

In file included from /usr/include/c++/4.0.2/backward/iostream.h:31,
from t.c:1:
/usr/include/c++/4.0.2/backward/backward_warning.h:32:2: 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 <iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.
--
View this message in context: http://www.nabble.com/can%27t-include-iostream.h-t1445505.html#a3904195
Sent from the gcc - Help forum at Nabble.com.
John Love-Jensen
2006-04-13 16:44:55 UTC
Permalink
Hi MaaSTaaR,

You should fix your code to use the C++ header: #include <iostream>

The C++ standard has been out for almost a decade now.

HTH,
--Eljay
MaaSTaaR
2006-04-13 16:49:46 UTC
Permalink
Hi John ...

great it's don't show me error messege , but the new problem it's now print
"Hello World" , this is a code

#include <iostream>

int main()
{
std::cout << "Hello World";
}

--
View this message in context: http://www.nabble.com/can%27t-include-iostream.h-t1445505.html#a3904340
Sent from the gcc - Help forum at Nabble.com.
John Love-Jensen
2006-04-13 16:51:20 UTC
Permalink
Hi MaaSTaaR,

Try this code:

#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
}

HTH,
--Eljay
MaaSTaaR
2006-04-13 16:56:44 UTC
Permalink
Hello ...

i tried it but the same problem don't print anything
--
View this message in context: http://www.nabble.com/can%27t-include-iostream.h-t1445505.html#a3904462
Sent from the gcc - Help forum at Nabble.com.
Perry Smith
2006-04-13 21:30:07 UTC
Permalink
The compiler will create an executable. Are you running the
executable? By default, I believe, it is called a.out Or you can
give it a name like:

gcc -o foo foo.c

where foo.c is your source file name and foo is the name of the
executable.

Then execute foo with:

./foo

HTH
Perry
Post by MaaSTaaR
Hello ...
i tried it but the same problem don't print anything
--
View this message in context: http://www.nabble.com/can%27t-include-
iostream.h-t1445505.html#a3904462
Sent from the gcc - Help forum at Nabble.com.
MaaSTaaR
2006-04-14 06:37:17 UTC
Permalink
Great it's work now ...

thank you very muck guys :)
--
View this message in context: http://www.nabble.com/can%27t-include-iostream.h-t1445505.html#a3913054
Sent from the gcc - Help forum at Nabble.com.
Brian D. McGrew
2006-04-13 21:41:37 UTC
Permalink
Iostream is a C++ header, not a C header and in all the newer version of
GCC, it's just iostream, not iostream.h. Try this

#include <iostream>

int
main(int argc, char *argv)
{
std::cout << "Hello World" << std::endl;
return(0);
}

g++ test.c -o test
./test

:b!

Brian D. McGrew { ***@visionpro.com || ***@doubledimension.com }
--
Those of you who think you know it all,
really annoy those of us who do!

-----Original Message-----
From: gcc-help-***@gcc.gnu.org [mailto:gcc-help-***@gcc.gnu.org] On
Behalf Of Perry Smith
Sent: Thursday, April 13, 2006 2:30 PM
To: MaaSTaaR
Cc: gcc-***@gcc.gnu.org
Subject: Re: can't include iostream.h

The compiler will create an executable. Are you running the
executable? By default, I believe, it is called a.out Or you can
give it a name like:

gcc -o foo foo.c

where foo.c is your source file name and foo is the name of the
executable.

Then execute foo with:

./foo

HTH
Perry
Hello ...
i tried it but the same problem don't print anything
--
View this message in context: http://www.nabble.com/can%27t-include-
iostream.h-t1445505.html#a3904462
Sent from the gcc - Help forum at Nabble.com.
MaaSTaaR
2006-04-14 06:47:46 UTC
Permalink
Great it's work now ...

thank you very muck guys :)
--
View this message in context: http://www.nabble.com/can%27t-include-iostream.h-t1445505.html#a3913132
Sent from the gcc - Help forum at Nabble.com.

Loading...