title: CodeBlocks HelloWorld C example not working: error "ptrdiff_t" not been declared
body: <p>I've always used MinGW or Dev-C++ to write code in C++ on Microsoft Windows, but now I have to use Code Blocks.
  I've downloaded it and installed it, with the standard procedure.</p>
  
  <p>I've tried to run the supersimple HelloWorld.cpp example file, but I got many compiling errors:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
    cout &lt;&lt; “Hello World!” &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Here's the list of my compiler errors:</p>
  
  <pre><code>Compiling: C:\Temp7\provaC\test00.cpp
  In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:49,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
                   from C:\Temp7\provaC\test00.cpp:1:
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef:52: error: `::ptrdiff_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef:53: error: `::size_t' has not been declared
  In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:51,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
                   from C:\Temp7\provaC\test00.cpp:1:
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:36: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:37: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:38: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:39: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:40: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:46: error: expected constructor, destructor, or type conversion before "strcspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:46: error: expected `,' or `;' before "strcspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:49: error: expected constructor, destructor, or type conversion before "strlen"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:49: error: expected `,' or `;' before "strlen"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:50: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:51: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:52: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:55: error: expected constructor, destructor, or type conversion before "strspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:55: error: expected `,' or `;' before "strspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:58: error: expected constructor, destructor, or type conversion before "strxfrm"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:58: error: expected `,' or `;' before "strxfrm"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:65: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:66: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:72: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:73: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:77: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:80: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:81: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:90: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:91: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:100: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:102: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:104: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:109: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:125: error: expected constructor, destructor, or type conversion before "wcscspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:125: error: expected `,' or `;' before "wcscspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:127: error: expected constructor, destructor, or type conversion before "wcslen"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:127: error: expected `,' or `;' before "wcslen"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:128: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:129: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:130: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:133: error: expected constructor, destructor, or type conversion before "wcsspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:133: error: expected `,' or `;' before "wcsspn"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:136: error: expected constructor, destructor, or type conversion before "wcsxfrm"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:136: error: expected `,' or `;' before "wcsxfrm"
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:150: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:151: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:157: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:158: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:175: error: `size_t' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h:176: error: `size_t' has not been declared
  In file included from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h:42,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ios:44,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:45,
                   from C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iostream:45,
                   from C:\Temp7\provaC\test00.cpp:1:
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:89: error: `::strxfrm' has not been declared
  C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring:90: error: `::strcspn' has not been declared
  Process terminated with status 1 (0 minutes, 5 seconds)
  </code></pre>
  
  <p>It seems that in the standard libraries some structures are absent (<code>ptr_diff_t</code>, <code>size_t</code>, etc).</p>
  
  <p>Could someone help me and let me compile my simple HelloWorld.cpp?</p>
  
  <p>Thanks!</p>