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....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-09-26
Why do your paths use 8.3 format names?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
//readandstoreallthestudents' data.// Invariant: `students'containsallthestudentrecordsreadsofar//`maxlen' contains the length of the longest name in `students'while(read(cin,record)){//findlengthoflongestnamemaxlen=max(maxlen,record.name.size());students.push_back(record);}//alphabetizethestudentrecordssort(students.begin(),students.end(),compare);//writethenamesandgradesfor(vector<Student_info>::size_typei=0;i!=students.size();++i){//writethename,paddedontherightto`maxlen' `+'`1' characters cout << students[i].name << string(maxlen + 1 - students[i].name.size(), '');//computeandwritethegradetry{doublefinal_grade=grade(students[i]);streamsizeprec=cout.precision();cout<<setprecision(3)<<final_grade<<setprecision(prec);}catch(domain_errore){cout<<e.what();}cout<<endl;}return0;
Hope I've done this correctly, and thanks to anyone who can help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-09-27
Post the whole log!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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....
FWIW, I have placed my files in C:\mycstuff\dev\ after reading the FAQ.... so that shouldn't be the problem.
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"
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
Why do your paths use 8.3 format names?
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
}
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!
Post the whole log!
... the log from a Rebuild All. The so called 'log' you posted does not even show the error message you are referring to!
<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.
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\
OK, I guess I'll try to remove and reinstall it....
Thanks to all who replied - after reinstalling with Dev-C++ 4.9.9.2, the program compiles and executes finally!
My answer to that would be - no clue..... I don't believe I intentionally did anything to set those paths....