Dev C%2b%2b Iostream No Such File Or Directory

  1. Dev C couldn't support iostream.h header file in C. When You Run program with iostream.h it shows error so we have a solution for this:) dev c iostrea.
  2. But when I tried the same code in Dev C, I got the following error- 1 21 C: Users Sujoy Krishna Das Documents Dev C Hello World.cpp Error iostream.h: No such file or directory - compilation terminated.
  3. Iostream is a C header, so you need to use g to compile it. Using is depreciated. Use iostream instead and either explicitly precede the commands with the namespace or use the line 'using namespace std;'.
  4. .Save Your file as (.cpp) thats all u need to do.
  5. I learned it as a beginner and I don't use it anymore so I don't see why not learn it and when it is unnecessary no longer use it, it is not hard to un-learn Jun 1, 2013 at 8:27am UTC raysonkong (3).
  1. Dev C 2b 2b Iostream No Such File Or Directory Linux
  2. Dev C 2b 2b Iostream No Such File Or Directory Number
  3. Dev C 2b 2b Iostream No Such File Or Directory File

Hello, I'm working with files in a C++ project AND the text file that I need to open is in the same directory, however when just trying to open it like this:

Fatal error: iostream: No such file or directory then you have probably given your source file a.c extension. /winchester-model-1892-serial-number.html. If you do that, the GCC compiler (and others) will probably attempt to compile the file as a C program, not as C. You should always give your C source files the extension.cpp to make sure the compiler handles them correctly.

It will not open, even though it's in the same directory, so then I have to put the file location (the directory path) which is fine BUT other people will be using this application and won't have access to my directory.

I want something that shows the current directory, like in C# there's a function for this. I can't seem to find the same one in C++ so I've been working with this:

But it just shows me the memory location, even if I have &mydir

Any suggestions? =)

  • 3 Contributors
  • forum4 Replies
  • 7,377 Views
  • 10 Hours Discussion Span
  • commentLatest PostLatest Postby Narue

Recommended Answers

getcwd() returns the current working directory. That's the directory to which you can expect relative paths to resolve. Thus, it certainly explains why your relative path isn't finding the file if the current working directory is different. An easy solution would be using chdir() to force the current directory you …

Dev C 2b 2b Iostream No Such File Or Directory Linux

Jump to Post

Dev C 2b 2b Iostream No Such File Or Directory Number

All 4 Replies

Dev C 2b 2b Iostream No Such File Or Directory File

Your compiler should support some form of getcwd(), check the documentation.