After checking around, I've managed to track down c++config.h on my hd, so that's not the problem. Here's the output from g++:
linux:~/programs/Ch3> g++ GradeBook.cpp -c
In file included from GradeBook.cpp:9:
/usr/include/g++/iomanip:49: error: syntax error before `namespace'
/usr/include/g++/iomanip:64: error: syntax error before `(' token
/usr/include/g++/iomanip:67: error: syntax error before `.' token
/usr/include/g++/iomanip:72: error: syntax error before `&' token
/usr/include/g++/iomanip:73: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:73: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:73: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:73: error: `__is' was not declared in this scope
/usr/include/g++/iomanip:73: error: `_Resetiosflags' was not declared in this
scope
/usr/include/g++/iomanip:73: error: syntax error before `)' token
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:75: error: `__is' undeclared (first use this function)
/usr/include/g++/iomanip:75: error: (Each undeclared identifier is reported
only once for each function it appears in.)
/usr/include/g++/iomanip:75: error: `ios_base' undeclared (first use this
function)
/usr/include/g++/iomanip:75: error: syntax error before `::' token
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:80: error: syntax error before `&' token
/usr/include/g++/iomanip:81: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:81: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:81: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:81: error: `__os' was not declared in this scope
/usr/include/g++/iomanip:81: error: `_Resetiosflags' was not declared in this
scope
/usr/include/g++/iomanip:81: error: syntax error before `)' token
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:83: error: `__os' undeclared (first use this function)
/usr/include/g++/iomanip:83: error: syntax error before `::' token
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:88: error: syntax error before `::' token
/usr/include/g++/iomanip:98: error: syntax error before `::' token
/usr/include/g++/iomanip: In function `_Setiosflags setiosflags(...)':
/usr/include/g++/iomanip:101: error: 'struct _Setiosflags' has no member named
'_M_mask'
/usr/include/g++/iomanip:101: error: `__mask' undeclared (first use this
function)
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:106: error: syntax error before `&' token
/usr/include/g++/iomanip:107: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:107: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:107: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:107: error: syntax error before `)' token
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:108: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:108: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:109: error: `__f' undeclared (first use this function)
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:114: error: syntax error before `&' token
/usr/include/g++/iomanip:115: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:115: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:115: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:115: error: syntax error before `)' token
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:116: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:116: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:141: error: syntax error before `&' token
/usr/include/g++/iomanip:142: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:142: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:142: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:142: error: syntax error before `)' token
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:143: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:143: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:143: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:144: error: syntax error before `::' token
/usr/include/g++/iomanip:145: error: syntax error before `::' token
/usr/include/g++/iomanip:146: error: syntax error before `::' token
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:152: error: syntax error before `&' token
/usr/include/g++/iomanip:153: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:153: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:153: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:153: error: syntax error before `)' token
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:154: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:154: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:154: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:155: error: syntax error before `::' token
/usr/include/g++/iomanip:156: error: syntax error before `::' token
/usr/include/g++/iomanip:157: error: syntax error before `::' token
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:183: error: syntax error before `&' token
/usr/include/g++/iomanip:184: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:184: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:184: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:184: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:184: error: template argument 1 is invalid
/usr/include/g++/iomanip:184: error: syntax error before `)' token
/usr/include/g++/iomanip:185: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:185: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:185: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:185: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:185: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:185: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:191: error: syntax error before `&' token
/usr/include/g++/iomanip:192: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:192: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:192: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:192: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:192: error: template argument 1 is invalid
/usr/include/g++/iomanip:192: error: syntax error before `)' token
/usr/include/g++/iomanip:193: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:193: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:193: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:193: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:193: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:193: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:217: error: syntax error before `&' token
/usr/include/g++/iomanip:218: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:218: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:218: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:218: error: syntax error before `)' token
/usr/include/g++/iomanip:219: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:219: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:219: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:185: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:219: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:185: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:219: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:219: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:219: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:225: error: syntax error before `&' token
/usr/include/g++/iomanip:226: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:226: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:226: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:226: error: syntax error before `)' token
/usr/include/g++/iomanip:227: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:227: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:227: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:193: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:227: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:193: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:227: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:227: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:227: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:251: error: syntax error before `&' token
/usr/include/g++/iomanip:252: error: `basic_istream' was not declared in this
scope
/usr/include/g++/iomanip:252: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:252: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:252: error: syntax error before `)' token
/usr/include/g++/iomanip:253: error: `int& operator>>(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:253: error: `int& operator>>(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator>>(...)':
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:219: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:219: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:185: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:143: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:108: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip:253: error: redefinition of `int& operator>>(...)'
/usr/include/g++/iomanip:74: error: `int& operator>>(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:259: error: syntax error before `&' token
/usr/include/g++/iomanip:260: error: `basic_ostream' was not declared in this
scope
/usr/include/g++/iomanip:260: error: `_CharT' was not declared in this scope
/usr/include/g++/iomanip:260: error: `_Traits' was not declared in this scope
/usr/include/g++/iomanip:260: error: syntax error before `)' token
/usr/include/g++/iomanip:261: error: `int& operator<<(...)' must have an
argument of class or enumerated type
/usr/include/g++/iomanip:261: error: `int& operator<<(...)' must take exactly
two arguments
/usr/include/g++/iomanip: In function `int& operator<<(...)':
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:227: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:227: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:193: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:154: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:116: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip:261: error: redefinition of `int& operator<<(...)'
/usr/include/g++/iomanip:82: error: `int& operator<<(...)' previously defined
here
/usr/include/g++/iomanip: At global scope:
/usr/include/g++/iomanip:270: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:270: error: syntax error before `&' token
/usr/include/g++/iomanip:271: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:271: error: syntax error before `&' token
/usr/include/g++/iomanip:272: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:272: error: syntax error before `&' token
/usr/include/g++/iomanip:273: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:273: error: syntax error before `&' token
/usr/include/g++/iomanip:274: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:274: error: syntax error before `&' token
/usr/include/g++/iomanip:275: error: explicit instantiation of non-template `
int ostream'
/usr/include/g++/iomanip:275: error: syntax error before `&' token
/usr/include/g++/iomanip:276: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:276: error: syntax error before `&' token
/usr/include/g++/iomanip:277: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:277: error: syntax error before `&' token
/usr/include/g++/iomanip:278: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:278: error: syntax error before `&' token
/usr/include/g++/iomanip:279: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:279: error: syntax error before `&' token
/usr/include/g++/iomanip:280: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:280: error: syntax error before `&' token
/usr/include/g++/iomanip:281: error: explicit instantiation of non-template `
int istream'
/usr/include/g++/iomanip:281: error: syntax error before `&' token
/usr/include/g++/iomanip:284: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:284: error: syntax error before `&' token
/usr/include/g++/iomanip:285: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:285: error: syntax error before `&' token
/usr/include/g++/iomanip:286: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:286: error: syntax error before `&' token
/usr/include/g++/iomanip:287: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:287: error: syntax error before `&' token
/usr/include/g++/iomanip:288: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:288: error: syntax error before `&' token
/usr/include/g++/iomanip:289: error: explicit instantiation of non-template `
int wostream'
/usr/include/g++/iomanip:289: error: syntax error before `&' token
/usr/include/g++/iomanip:290: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:290: error: syntax error before `&' token
/usr/include/g++/iomanip:291: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:291: error: syntax error before `&' token
/usr/include/g++/iomanip:292: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:292: error: syntax error before `&' token
/usr/include/g++/iomanip:293: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:293: error: syntax error before `&' token
/usr/include/g++/iomanip:294: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:294: error: syntax error before `&' token
/usr/include/g++/iomanip:295: error: explicit instantiation of non-template `
int wistream'
/usr/include/g++/iomanip:295: error: syntax error before `&' token
GradeBook.cpp:10: error: `setprecision' not declared
In file included from GradeBook.cpp:12:
GradeBook.h:17:26: warning: no newline at end of file
GradeBook.cpp: In member function `void GradeBook::determineClassAverage()':
GradeBook.cpp:71: error: ambiguous overload for 'operator<<' in '
std:
perator<< [with _Traits = std::char_traits<char>]((&std::cout), "Class
average is ") << setprecision(int)()'
/usr/include/g++/iomanip:82: error: candidates are: int& operator<<(...)
/usr/include/g++/iomanip:116: error: int& operator<<(...)
/usr/include/g++/iomanip:154: error: int& operator<<(...)
/usr/include/g++/iomanip:193: error: int& operator<<(...)
/usr/include/g++/iomanip:227: error: int& operator<<(...)
/usr/include/g++/iomanip:261: error: int& operator<<(...)
GradeBook.cpp:71: error: `fixed' undeclared (first use this function)
I have NO IDEA what's going on here. #include <iostream> works fine, but when I #include <iomanip> two lines later, I get, well, all that ^^^.