title: ubuntu gcc error ctype was not declared in this scope
body: <p>I encountered this problem today. I can compile the project using QT4 in ubuntu 12.04 yesterday, but today I find that any c++ project could not been compiled because of these errors. I have upgrade my system to the latest.</p>
  
  <p>Does anyone give me some advice, please? Thank you.</p>
  
  <pre><code>/usr/include/c++/4.6/bits/locale_facets.h:2561:50: error: ‘ctype_base’ has not been declared
  /usr/include/c++/4.6/bits/locale_facets.h:2543:14: note: suggested alternative:
  /usr/include/c++/4.6/bits/locale_classes.tcc:107:5: note:   ‘std::use_facet’
  /usr/include/c++/4.6/bits/locale_facets.h: At global scope:
  /usr/include/c++/4.6/bits/locale_facets.h:2566:5: error: ‘isdigit’ declared as an ‘inline’ variable
  /usr/include/c++/4.6/bits/locale_facets.h:2543:24: error: ‘ctype’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2566:5: error: template declaration of ‘bool isdigit’
  /usr/include/c++/4.6/bits/locale_facets.h:2543:24: note: suggested alternative:
  /usr/include/c++/4.6/bits/locale_facets.h:2567:7: error: expected primary-expression before ‘return’
  /usr/include/c++/4.6/bits/locale_facets.h:2567:7: error: expected ‘}’ before ‘return’/usr/include/c++/4.6/bits/localefwd.h:123:11: note:   ‘std::ctype’
  
  /usr/include/c++/4.6/bits/locale_facets.h:2567:75: error: expected declaration before ‘}’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2543:36: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2543:38: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2543:47: error: request for member ‘is’ in ‘__loc’, which is of non-class type ‘const int’
  /usr/include/c++/4.6/bits/locale_facets.h:2543:50: error: ‘ctype_base’ has not been declared
  /usr/include/c++/4.6/bits/locale_facets.h: At global scope:
  /usr/include/c++/4.6/bits/locale_facets.h:2548:31: error: ‘locale’ does not name a type
  /usr/include/c++/4.6/bits/locale_facets.h: In function ‘bool isupper(_CharT, const int&amp;)’:
  /usr/include/c++/4.6/bits/locale_facets.h:2549:14: error: ‘use_facet’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2549:14: note: suggested alternative:
  /usr/include/c++/4.6/bits/locale_classes.tcc:107:5: note:   ‘std::use_facet’
  /usr/include/c++/4.6/bits/locale_facets.h:2549:24: error: ‘ctype’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2549:24: note: suggested alternative:
  /usr/include/c++/4.6/bits/localefwd.h:123:11: note:   ‘std::ctype’
  /usr/include/c++/4.6/bits/locale_facets.h:2549:36: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2549:38: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2549:47: error: request for member ‘is’ in ‘__loc’, which is of non-class type ‘const int’
  /usr/include/c++/4.6/bits/locale_facets.h:2549:50: error: ‘ctype_base’ has not been declared
  /usr/include/c++/4.6/bits/locale_facets.h: At global scope:
  /usr/include/c++/4.6/bits/locale_facets.h:2554:31: error: ‘locale’ does not name a type
  /usr/include/c++/4.6/bits/locale_facets.h: In function ‘bool islower(_CharT, const int&amp;)’:
  /usr/include/c++/4.6/bits/locale_facets.h:2555:14: error: ‘use_facet’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2555:14: note: suggested alternative:
  /usr/include/c++/4.6/bits/locale_classes.tcc:107:5: note:   ‘std::use_facet’
  /usr/include/c++/4.6/bits/locale_facets.h:2555:24: error: ‘ctype’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2555:24: note: suggested alternative:
  /usr/include/c++/4.6/bits/localefwd.h:123:11: note:   ‘std::ctype’
  /usr/include/c++/4.6/bits/locale_facets.h:2555:36: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2555:38: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2555:47: error: request for member ‘is’ in ‘__loc’, which is of non-class type ‘const int’
  make[2]: *** 
  /usr/include/c++/4.6/bits/locale_facets.h: At global scope:
  /usr/include/c++/4.6/bits/locale_facets.h:2560:31: error: ‘locale’ does not name a type
  /usr/include/c++/4.6/bits/locale_facets.h: In function ‘bool isalpha(_CharT, const int&amp;)’:
  /usr/include/c++/4.6/bits/locale_facets.h:2561:14: error: ‘use_facet’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2561:14: note: suggested alternative:
  /usr/include/c++/4.6/bits/locale_classes.tcc:107:5: note:   ‘std::use_facet’
  /usr/include/c++/4.6/bits/locale_facets.h:2561:24: error: ‘ctype’ was not declared in this scope
  /usr/include/c++/4.6/bits/locale_facets.h:2561:24: note: suggested alternative:
  /usr/include/c++/4.6/bits/localefwd.h:123:11: note:   ‘std::ctype’
  /usr/include/c++/4.6/bits/locale_facets.h:2561:36: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2561:38: error: expected primary-expression before ‘&gt;’ token
  /usr/include/c++/4.6/bits/locale_facets.h:2561:47: error: request for member ‘is’ in ‘__loc’, which is of non-class type ‘const int’
  /usr/include/c++/4.6/bits/locale_facets.h:2561:50: error: ‘ctype_base’ has not been declared
  /usr/include/c++/4.6/bits/locale_facets.h: At global scope:
  /usr/include/c++/4.6/bits/locale_facets.h:2566:5: error: ‘isdigit’ declared as an ‘inline’ variable
  /usr/include/c++/4.6/bits/locale_facets.h:2566:5: error: template declaration of ‘bool isdigit’
  /usr/include/c++/4.6/bits/locale_facets.h:2567:7: error: expected primary-expression before ‘return’
  /usr/include/c++/4.6/bits/locale_facets.h:2567:7: error: expected ‘}’ before ‘return’
  /usr/include/c++/4.6/bits/locale_facets.h:2567:75: error: expected declaration before ‘}’ token
  make[2]: *** 
  </code></pre>