chitrangda Posted February 3, 2009 Posted February 3, 2009 I was working on C++ and encountered following error "Fatal iostream.h 19: Error directive : Must use C++ for the type iostream" can anyone tell me what does this mean!
timo Posted February 3, 2009 Posted February 3, 2009 Supposedly that you tried to compile the program with a C compiler (or linker) rather than a C++ one. That's just a guess, though.
D H Posted February 3, 2009 Posted February 3, 2009 What header files did you include? Did you do something bad like #include <iostream.h> rather than <iostream> ?
chitrangda Posted February 3, 2009 Author Posted February 3, 2009 i did <iostream>not #include<iostream.h> i used <stdlib>, <process> amongst others
D H Posted February 3, 2009 Posted February 3, 2009 OK then. A couple other possibilities: Did you name your file "myprogram.c" rather than "myprogram.cc" (or "myprogram.cpp" or "myprogram.c++")? Some compilers know that .c files are to be compiled as if they are written in C rather than C++. Do you have an unterminated extern "C" { (i.e., missing close brace) lurking around somewhere, including in the headers files you #included before the #include <iostream> directive?
chitrangda Posted February 3, 2009 Author Posted February 3, 2009 OK then. A couple other possibilities: Did you name your file "myprogram.c" rather than "myprogram.cc" (or "myprogram.cpp" or "myprogram.c++")? Some compilers know that .c files are to be compiled as if they are written in C rather than C++. Do you have an unterminated extern "C" { (i.e., missing close brace) lurking around somewhere, including in the headers files you #included before the #include <iostream> directive? no such error done by me.
Shadow Posted February 3, 2009 Posted February 3, 2009 Do you have #include before <iostream>? Because that wasn't very obvious from your post...
chitrangda Posted February 7, 2009 Author Posted February 7, 2009 Thanks all for the suggestions but the problem was with the compiler..i changed it and now its working..
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now