Header file error while using cc1plus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
For the below program:

#include <iostream.h>
using namespace std;
void myFunction()
{
        try{
                int *p=new int;
                *p=5;
        }
        catch(std::bad_alloc& ba)
        {
                std::cerr<<"bad_alloc caught: "<<ba.what()<<'\n';
        }
}
int main()
{
        myFunction();
        return 0;
}

When I try to compile it with `cc1plus` via command :
./cc1plus -fanalyzer example8.cpp

I get the following error:
example8.cpp:2:10: fatal error: iostream.h: No such file or directory
    2 | #include <iostream.h>
      |          ^~~~~~~~~~~~

Can someone please let me know how to resolve this?

Thanks,
Saloni Garg



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux