This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help Needed


"R.Karthik Narayanan" <rkarthik at cs dot ucf dot edu> writes:

> Hi,
>    I am R.Karthik Narayanan, I am student at UCF. I have been trying to do
> programming in lunix using GCC. I find that my C programs work without any
> errors. But the problems seems to happend when i do GCC for C++ programs. It
> fails to find the file iostream.h.

iostream.h is not part of ISO C++. The name was changed to <iostream>
    (no suffix) during the standarization process which was completed
    in 1998. (Although the iostream.h => iostream change was final
    long before most of the other changes.)

Since you don't know about <iostream>, I'm going to assume you don't
    know about the std namespace. During the standarization process,
    all standard C++ library names, including cout, endl, string, etc,
    were moved into the std namespace. Here is an example:

#include<iostream>
#include<ostream>

using std::cout;
using std::endl;

int main()
{
    cout << "Hello world" << endl;
}

> But, there is no error nad the program
> compiles.

I think there is some confusion. If iostream is required, but not
    found, the program will not compile. You must copy and paste the
    exact error messages you get, and the code that reproduces them
    (or a simplified version thereof). If you don't do that, people
    can only guess at your problem, and are less able to help you.

> But when i try to execute it using ./name of compiled file, there is
> no reponse, the program doesn't run. Can u please guide me as to how solve this
> problem.
[snip]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]