Menu

ios: No such file or directory

earache
2007-09-25
2012-09-26
  • earache

    earache - 2007-09-25

    Hi, I checked the FAQ on this and as far as I can tell, my directory paths are OK:

    Bin directory: C:\DEV-C_~1\Bin\
    C include files: C:\DEV-C_~1\Include\
    C++ include files: C:\DEV-C_~1\Include\G++;C:\DEV-C_~1\Include\
    Libraries directory: C:\DEV-C_~1\Lib\

    I'm trying to compile an example from "Accelerated C++" by the following process: I downloaded the source files from acceleratedcpp.com as source code (packaged for Windows systems using Borland C++Builder Version 5 or later). I then created a new folder and copied the various cpp and .h files into it, then created a new Project as a Console application, removed the "untitled1" file from the project, and added all the files that I had previously copied into the project. I consistently get the above subject message when I try to compile.

    Would it have made any difference if I had downloaded the source code packaged either for Visual Studio .Net or Visual C++ compiler, or for Unix systems (my only other options)?

    For what it's worth, there's only one main function defined in the various files, and the source file containing that function is consistently the one that DevC++ says is missing....

     
    • earache

      earache - 2007-09-26

      FWIW, I have placed my files in C:\mycstuff\dev\ after reading the FAQ.... so that shouldn't be the problem.

       
      • Wayne Keen

        Wayne Keen - 2007-09-26

        You really would do a LOT better if you posted your Basic 3 for a simple as possible test case - descriptions are nice and provide context, but tractable/focused source code and the options used to compile it (as embodied in the Basic 3) provide people with the basis for seeing what you are.

        Wayne

        p.s. The Basic 3 are covered in the thread titled "Please Read Before Posting a Question"

         
        • Wayne Keen

          Wayne Keen - 2007-09-26

          Please do not post a link to code, copy and paste the exact code you are trying to compile. And do not succumb to the temptation to excerpt just the error messages from the compile log - post the log from the beginning - it is on the tab labeled "Compile Log", and the right mouse button brings up the copy menu.

          If you have a ton or errors - post through the first 5 or so errors.

          Wayne

           
    • Anonymous

      Anonymous - 2007-09-26

      Why do your paths use 8.3 format names?

       
    • earache

      earache - 2007-09-27

      Ok, starting over :-)

      Using DevC++ v4, WinXP SP2;

      Source code for the main3.cpp file that doesn't get compiled:

      include <algorithm>

      include <iomanip>

      include <ios>

      include <iostream>

      include <stdexcept>

      include <string>

      include <vector>

      include "grade.h"

      include "Student_info.h"

      using std::cin; using std::setprecision;
      using std::cout; using std::sort;
      using std::domain_error; using std::streamsize;
      using std::endl; using std::string;
      using std::max; using std::vector;

      int main()
      {
      vector<Student_info> students;
      Student_info record;
      string::size_type maxlen = 0; // the length of the longest name

      // read and store all the students' data.
      // Invariant:   `students' contains all the student records read so far
      //          `maxlen' contains the length of the longest name in `students'
      while (read(cin, record)) {
          // find length of longest name
          maxlen = max(maxlen, record.name.size());
          students.push_back(record);
      }
      
      // alphabetize the student records
      sort(students.begin(), students.end(), compare);
      
      // write the names and grades
      for (vector&lt;Student_info&gt;::size_type i = 0;
           i != students.size(); ++i) {
      
          // write the name, padded on the right to `maxlen' `+' `1' characters
          cout &lt;&lt; students[i].name
               &lt;&lt; string(maxlen + 1 - students[i].name.size(), ' ');
      
          // compute and write the grade
          try {
              double final_grade = grade(students[i]);
              streamsize prec = cout.precision();
              cout &lt;&lt; setprecision(3) &lt;&lt; final_grade
                   &lt;&lt; setprecision(prec);
          } catch (domain_error e) {
              cout &lt;&lt; e.what();
          }
          cout &lt;&lt; endl;
      }
      return 0;
      

      }

      And finally, the compile log:

      Building resource file...
      Compiling files :
      C:\DEV-C_~1\Bin\g++ "c:\mycstuff\dev\studentgrades\grade.cpp" "c:\mycstuff\dev\studentgrades\main3.cpp" "c:\mycstuff\dev\studentgrades\median.cpp" "c:\mycstuff\dev\studentgrades\student_info.cpp" -c -s -IC:\DEV-C_~1\Include\ -IC:\DEV-C_~1\Include\G__~1 -IC:\DEV-C_~1\Include\ -LC:\DEV-C_~1\Lib\ -BC:\DEV-C_~1\Bin\

      Hope I've done this correctly, and thanks to anyone who can help!

       
    • Anonymous

      Anonymous - 2007-09-27

      Post the whole log!

       
      • Anonymous

        Anonymous - 2007-09-27

        ... the log from a Rebuild All. The so called 'log' you posted does not even show the error message you are referring to!

         
    • Anonymous

      Anonymous - 2007-09-27

      <ios> should be in C:\Dev-Cpp\include\c++\3.4.2 It does not look like you have that as a -I path, and I cannot think what C:\DEV-C_~1\Include\G__~1 might be in a standard installation. The -B option is non-standard. You seem to have a non-standard installation altogether. Make it standard and perhaps you might get somewhere. A clean re-install might be in order because you or someone has buggered with this one.

      Perhaps however the path of least resistance is to use Microsoft's free VC++ 2005 Express Edition.

       
    • earache

      earache - 2007-09-27

      Here's the compiler and linker output:

      c:\mycstuff\dev\studentgrades\main3.cpp:3: ios: No such file or directory

      and here's the entire compile log:

      C:\DEV-C_~1\Bin\windres --include-dir C:\DEV-C_~1\Include\ --include-dir C:\DEV-C_~1\Include\G__~1 --include-dir C:\DEV-C_~1\Include\ --use-temp-file -I rc -O coff -i C:\mycstuff\dev\STUDEN~1\rsrc.rc -o c:\mycstuff\dev\studen~1\rsrc.o
      Compiling files :
      C:\DEV-C_~1\Bin\g++ "c:\mycstuff\dev\studentgrades\grade.cpp" "c:\mycstuff\dev\studentgrades\main3.cpp" "c:\mycstuff\dev\studentgrades\median.cpp" "c:\mycstuff\dev\studentgrades\student_info.cpp" -c -s -IC:\DEV-C_~1\Include\ -IC:\DEV-C_~1\Include\G__~1 -IC:\DEV-C_~1\Include\ -LC:\DEV-C_~1\Lib\ -BC:\DEV-C_~1\Bin\

       
    • earache

      earache - 2007-09-27

      OK, I guess I'll try to remove and reinstall it....

       
    • earache

      earache - 2007-09-28

      Thanks to all who replied - after reinstalling with Dev-C++ 4.9.9.2, the program compiles and executes finally!

       
    • earache

      earache - 2007-09-27

      My answer to that would be - no clue..... I don't believe I intentionally did anything to set those paths....

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.