the_nomad
February 18th, 2007, 03:26 PM
im trying to compile the next code but i get a whole bunch of errors...
#include <iostream>
using namespace std;
class CRectangle {
int x, y;
public:
void set_values (int,int);
int area () {return (x*y);}
};
void CRectangle::set_values (int a, int b) {
x = a;
y = b;
}
int main () {
CRectangle rect;
rect.set_values (3,4);
cout << "area: " << rect.area();
return 0;
}
i got this example from a tutorial on cplusplus.com and it should work.... does anyone have any ideea on what am i doing bad? i've just installed g++ through 'sudo apt-get install g++'...
thanx in advance.
the_nomad
February 18th, 2007, 03:45 PM
first i changed the directory to the one the file is and then 'g++ file.cpp'
and i got these errs:
/usr/include/c++/4.0.2/bits/codecvt.h:458: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/codecvt.h:458: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:1708: error: expected `)' before ‘__cloc’
/usr/include/c++/4.0.2/bits/locale_facets.h:1865: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:1876: error: variable or field ‘_M_initialize_numpunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:1876: error: ‘int std::numpunct<char>::_M_initialize_numpunct’ is not a static member of ‘class std::numpunct<char>’/usr/include/c++/4.0.2/bits/locale_facets.h:1876: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:1884: error: variable or field ‘_M_initialize_numpunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:1884: error: ‘int std::numpunct<wchar_t>::_M_initialize_numpunct’ is not a static member of ‘class std::numpunct<wchar_t>’
/usr/include/c++/4.0.2/bits/locale_facets.h:1884: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: In constructor ‘std::numpunct_byname<_CharT>::numpunct_byname(const char*, size_t)’:
/usr/include/c++/4.0.2/bits/locale_facets.h:1899: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h:1899: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h:1901: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:1901: error: expected `;' before ‘__tmp’
/usr/include/c++/4.0.2/bits/locale_facets.h:1902: error: ‘__tmp’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:2479: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.0.2/bits/locale_facets.h:2507: error: expected `)' before ‘__cloc’
/usr/include/c++/4.0.2/bits/locale_facets.h: In constructor ‘std::collate<_CharT>::collate(size_t)’:
/usr/include/c++/4.0.2/bits/locale_facets.h:2494: error: class ‘std::collate<_CharT>’ does not have any field named ‘_M_c_locale_collate’
/usr/include/c++/4.0.2/bits/locale_facets.h:2494: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.h: In destructor ‘virtual std::collate<_CharT>::~collate()’:
/usr/include/c++/4.0.2/bits/locale_facets.h:2571: error: ‘_M_c_locale_collate’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: In constructor ‘std::collate_byname<_CharT>::collate_byname(const char*, size_t)’:
/usr/include/c++/4.0.2/bits/locale_facets.h:2655: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h:2655: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:2809: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.0.2/bits/locale_facets.h:2833: error: expected `)' before ‘__cloc’
/usr/include/c++/4.0.2/bits/locale_facets.h:2839: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.h:2940: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:2949: error: variable or field ‘_M_initialize_timepunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:2949: error: ‘int std::__timepunct<char>::_M_initialize_timepunct’ is not a static member of ‘class std::__timepunct<char>’
/usr/include/c++/4.0.2/bits/locale_facets.h:2949: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:2953: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.h:2958: error: variable or field ‘_M_initialize_timepunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:2958: error: ‘int std::__timepunct<wchar_t>::_M_initialize_timepunct’ is not a static member of ‘class std::__timepunct<wchar_t>’
/usr/include/c++/4.0.2/bits/locale_facets.h:2958: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:2963: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h: In constructor ‘std::__timepunct<_CharT>::__timepunct(size_t)’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h:39: error: class ‘std::__timepunct<_CharT>’ does not have any field named ‘_M_c_locale_timepunct’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h: In constructor ‘std::__timepunct<_CharT>::__timepunct(std::__timepunct_cache<_CharT>*, size_t)’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h:45: error: class ‘std::__timepunct<_CharT>’ does not have any field named ‘_M_c_locale_timepunct’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h: At global scope:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h:50: error: expected constructor, destructor, or type conversion before ‘(’ token
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h: In destructor ‘virtual std::__timepunct<_CharT>::~__timepunct()’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/time_members.h:67: error: ‘_M_c_locale_timepunct’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:3046: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3071: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3099: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3128: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3154: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3192: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3211: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3230: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3249: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3268: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3286: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3363: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.h:3384: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.h:3410: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.h: In member function ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const’:
/usr/include/c++/4.0.2/bits/locale_facets.h:3385: error: ‘__tm’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3385: error: ‘__format’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3385: error: ‘__mod’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:3596: error: expected `)' before ‘__cloc’
/usr/include/c++/4.0.2/bits/locale_facets.h:3883: error: ‘__c_locale’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.h:3901: error: variable or field ‘_M_initialize_moneypunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:3901: error: ‘int std::moneypunct<char, true>::_M_initialize_moneypunct’ is not a static member of ‘class std::moneypunct<char, true>’
/usr/include/c++/4.0.2/bits/locale_facets.h:3901: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3901: error: expected primary-expression before ‘const’
/usr/include/c++/4.0.2/bits/locale_facets.h:3901: error: initializer expression list treated as compound expression
/usr/include/c++/4.0.2/bits/locale_facets.h:3905: error: variable or field ‘_M_initialize_moneypunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:3905: error: ‘int std::moneypunct<char, false>::_M_initialize_moneypunct’ is not a static member of ‘class std::moneypunct<char, false>’
/usr/include/c++/4.0.2/bits/locale_facets.h:3905: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3905: error: expected primary-expression before ‘const’
/usr/include/c++/4.0.2/bits/locale_facets.h:3905: error: initializer expression list treated as compound expression
/usr/include/c++/4.0.2/bits/locale_facets.h:3916: error: variable or field ‘_M_initialize_moneypunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:3916: error: ‘int std::moneypunct<wchar_t, true>::_M_initialize_moneypunct’ is not a static member of ‘class std::moneypunct<wchar_t, true>’
/usr/include/c++/4.0.2/bits/locale_facets.h:3916: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3917: error: expected primary-expression before ‘const’
/usr/include/c++/4.0.2/bits/locale_facets.h:3917: error: initializer expression list treated as compound expression
/usr/include/c++/4.0.2/bits/locale_facets.h:3921: error: variable or field ‘_M_initialize_moneypunct’ declared void
/usr/include/c++/4.0.2/bits/locale_facets.h:3921: error: ‘int std::moneypunct<wchar_t, false>::_M_initialize_moneypunct’ is not a static member of ‘class std::moneypunct<wchar_t, false>’
/usr/include/c++/4.0.2/bits/locale_facets.h:3921: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3922: error: expected primary-expression before ‘const’
/usr/include/c++/4.0.2/bits/locale_facets.h:3922: error: initializer expression list treated as compound expression
/usr/include/c++/4.0.2/bits/locale_facets.h: In constructor ‘std::moneypunct_byname<_CharT, _Intl>::moneypunct_byname(const char*, size_t)’:
/usr/include/c++/4.0.2/bits/locale_facets.h:3939: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h:3939: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/locale_facets.h:3941: error: ‘__c_locale’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h:3941: error: expected `;' before ‘__tmp’
/usr/include/c++/4.0.2/bits/locale_facets.h:3942: error: ‘__tmp’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h:4271: error: ‘__c_locale’ does not name a type
/usr/include/c++/4.0.2/bits/locale_facets.h:4300: error: expected `)' before ‘__cloc’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h: In constructor ‘std::messages<_CharT>::messages(size_t)’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:39: error: class ‘std::messages<_CharT>’ does not have any field named ‘_M_c_locale_messages’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:39: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h: At global scope:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:44: error: expected constructor, destructor, or type conversion before ‘(’ token
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h: In destructor ‘virtual std::messages<_CharT>::~messages()’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:69: error: ‘_M_c_locale_messages’ was not declared in this scope
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h: In constructor ‘std::messages_byname<_CharT>::messages_byname(const char*, size_t)’:
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:95: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:96: error: ‘strcpy’ is not a member of ‘std’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:99: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/i486-linux-gnu/bits/messages_members.h:99: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.0.2/bits/basic_ios.h: At global scope:
/usr/include/c++/4.0.2/bits/basic_ios.h: In instantiation of ‘std::basic_ios<char, std::char_traits<char> >’:
/usr/include/c++/4.0.2/bits/basic_ios.tcc:192: instantiated from here
/usr/include/c++/4.0.2/bits/basic_ios.h:68: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/bits/basic_ios.h: In instantiation of ‘std::basic_ios<wchar_t, std::char_traits<wchar_t> >’:
/usr/include/c++/4.0.2/bits/basic_ios.tcc:195: instantiated from here
/usr/include/c++/4.0.2/bits/basic_ios.h:66: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/bits/basic_ios.h:68: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, float&) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:750: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, double&) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:763: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, long double&) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:776: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘_OutIter std::num_put<_CharT, _OutIter>::_M_insert_float(_OutIter, std::ios_base&, _CharT, char, _ValueT) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1066: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1074: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::money_get<_CharT, _InIter>::do_get(_InIter, _InIter, bool, std::ios_base&, std::_Ios_Iostate&, long double&) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1479: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _OutIter std::money_put<_CharT, _OutIter>::do_put(_OutIter, bool, std::ios_base&, _CharT, long double) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1688: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1695: error: there are no arguments to ‘_S_get_c_locale’ that depend on a template parameter, so a declaration of ‘_S_get_c_locale’ must be available
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1735: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘_InIter std::time_get<_CharT, _InIter>::_M_extract_via_format(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, int*, const _CharT*) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1760: error: request for member ‘tm_wday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1767: error: request for member ‘tm_wday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1775: error: request for member ‘tm_mon’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1782: error: request for member ‘tm_mon’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1794: error: request for member ‘tm_mday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1801: error: request for member ‘tm_mday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1804: error: request for member ‘tm_mday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1816: error: request for member ‘tm_hour’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1821: error: request for member ‘tm_hour’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1829: error: request for member ‘tm_mon’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1833: error: request for member ‘tm_min’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1853: error: request for member ‘tm_sec’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1889: error: request for member ‘tm_year’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:1897: error: request for member ‘tm_year’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2055: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2072: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2089: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_weekday(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, int*) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2123: error: request for member ‘tm_wday’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2134: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_monthname(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, int*) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2169: error: request for member ‘tm_mon’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2180: error: ‘tm’ has not been declared
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_year(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, int*) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2196: error: request for member ‘tm_year’ in ‘__tm->’, which is of non-class type ‘int’
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2207: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2208: error: redefinition of ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const’
/usr/include/c++/4.0.2/bits/locale_facets.h:3384: error: ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const’ previously declared here
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2212: error: ‘__beg’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2212: error: ‘__end’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2232: error: ‘__tm’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2242: error: expected ‘,’ or ‘...’ before ‘*’ token
/usr/include/c++/4.0.2/bits/locale_facets.tcc: In member function ‘virtual _OutIter std::time_put<_CharT, _OutIter>::do_put(_OutIter, std::ios_base&, _CharT, int) const’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2262: error: ‘__mod’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2264: error: ‘__format’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2270: error: ‘__format’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2274: error: ‘__tm’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.h: At global scope:
/usr/include/c++/4.0.2/bits/locale_facets.h: In instantiation of ‘std::time_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2509: instantiated from here
/usr/include/c++/4.0.2/bits/locale_facets.h:3384: error: ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const [with _CharT = char, _OutIter = std::ostreambuf_iterator<char, std::char_traits<char> >]’ cannot be overloaded
/usr/include/c++/4.0.2/bits/locale_facets.h:3364: error: with ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const [with _CharT = char, _OutIter = std::ostreambuf_iterator<char, std::char_traits<char> >]’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2516: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2516: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2521: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2521: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2522: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2522: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2522: error: template-id ‘use_facet<<expression error> >’ for ‘const int& std::use_facet(const std::locale&)’ does not match any template declaration
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2578: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2578: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2578: error: template-id ‘has_facet<<expression error> >’ for ‘bool std::has_facet(const std::locale&)’ does not match any template declaration
/usr/include/c++/4.0.2/bits/locale_facets.h: In instantiation of ‘std::time_put<wchar_t, std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> > >’:
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2636: instantiated from here
/usr/include/c++/4.0.2/bits/locale_facets.h:3384: error: ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const [with _CharT = wchar_t, _OutIter = std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> >]’ cannot be overloaded
/usr/include/c++/4.0.2/bits/locale_facets.h:3364: error: with ‘_OutIter std::time_put<_CharT, _OutIter>::put(_OutIter, std::ios_base&, _CharT, int) const [with _CharT = wchar_t, _OutIter = std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> >]’
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2643: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2643: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2648: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2648: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2649: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2649: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2649: error: template-id ‘use_facet<<expression error> >’ for ‘const int& std::use_facet(const std::locale&)’ does not match any template declaration
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2705: error: ‘mbstate_t’ was not declared in this scope
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2705: error: template argument 3 is invalid
/usr/include/c++/4.0.2/bits/locale_facets.tcc:2705: error: template-id ‘has_facet<<expression error> >’ for ‘bool std::has_facet(const std::locale&)’ does not match any template declaration
/usr/include/c++/4.0.2/ostream: In instantiation of ‘std::basic_ostream<char, std::char_traits<char> >’:
/usr/include/c++/4.0.2/bits/ostream.tcc:680: instantiated from here
/usr/include/c++/4.0.2/ostream:64: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/bits/ostream.tcc:451: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/ostream: In instantiation of ‘std::basic_ostream<wchar_t, std::char_traits<wchar_t> >’:
/usr/include/c++/4.0.2/bits/ostream.tcc:692: instantiated from here
/usr/include/c++/4.0.2/ostream:62: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/ostream:64: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/bits/ostream.tcc:451: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream: In instantiation of ‘std::basic_istream<char, std::char_traits<char> >’:
/usr/include/c++/4.0.2/istream:580: instantiated from here
/usr/include/c++/4.0.2/istream:65: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/istream:569: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/istream: In instantiation of ‘std::basic_istream<wchar_t, std::char_traits<wchar_t> >’:
/usr/include/c++/4.0.2/istream:596: instantiated from here
/usr/include/c++/4.0.2/istream:63: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:65: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:272: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:427: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:438: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:569: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream: In instantiation of ‘std::basic_iostream<char, std::char_traits<char> >’:
/usr/include/c++/4.0.2/bits/istream.tcc:1273: instantiated from here
/usr/include/c++/4.0.2/istream:757: error: no type named ‘off_type’ in ‘struct std::char_traits<char>’
/usr/include/c++/4.0.2/istream: In instantiation of ‘std::basic_istream<wchar_t, std::char_traits<wchar_t> >::sentry’:
/usr/include/c++/4.0.2/bits/istream.tcc:1276: instantiated from here
/usr/include/c++/4.0.2/istream:630: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream: In instantiation of ‘std::basic_iostream<wchar_t, std::char_traits<wchar_t> >’:
/usr/include/c++/4.0.2/bits/istream.tcc:1281: instantiated from here
/usr/include/c++/4.0.2/istream:755: error: no type named ‘int_type’ in ‘struct std::char_traits<wchar_t>’
/usr/include/c++/4.0.2/istream:757: error: no type named ‘off_type’ in ‘struct std::char_traits<wchar_t>’
... and many many many others :(
WW
February 18th, 2007, 03:54 PM
Wow. I hope someone else can figure that out.
I have only one suggestion--really a shot in the dark. I installed g++ indirectly, by installing the package build-essential. Installing this package will install gcc, g++, some basic libraries, the "make" command, and a couple other things. *Maybe* you are missing a library (or something) that is necessary for compiling g++ programs. (But I would expect g++ to depend on whatever it is that might be missing, so this idea is probably nonsense.) You could try installing build-essential:
$ sudo apt-get install build-essential
and then try to compile your program again.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.