C++ on uBuntu : fatal error:library iostream.h not found

madhuri thalluri
@madhuri-thalluri-1xTqQR โ€ข Oct 26, 2024

hi...when i write a simple hello c++ program and executed in ubuntu13.0 its showing fatal error:library iostream.h not found like dat..wen i tried to install g++compiler using apt get command its showing something like these packages are not existed..now what should i do???i want to execute c++ programs???can anyone tell what is the problem nd what i should do for it??

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Abhishek Rawal

    @abhishek-fg9tRh • Apr 26, 2014

    That's because GNU GCC-C++ (aka g++) doesn't accept "iostream.h" syntax.
    Just use <iostream>

  • madhuri thalluri

    @madhuri-thalluri-1xTqQR • Apr 26, 2014

    Abhishek RawalThat's because GNU GCC-C++ (aka g++) doesn't accept "iostream.h" syntax.
    Just use <iostream>

    sryy abhishek...i tried it..but its showing error that "cout is not in the scope of int main()"...

  • Abhishek Rawal

    @abhishek-fg9tRh • Apr 27, 2014

    madhuri thallurisryy abhishek...i tried it..but its showing error that "cout is not in the scope of int main()"...

    add this line

    using namespace std;

    below [HASHTAG]#include[/HASHTAG] <iostream>

    It should look something like

    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout << "CrazyEngineers";
    }

    If this too fails, then you might've made some mistake in installing compiler.
    Re-installing libstdc++-dev and g++-multilib can fix it.