Author Topic: Even the default hello world program produce 50 errors!!  (Read 134 times)

Offline ace99singh

  • Single posting newcomer
  • *
  • Posts: 1
Even the default hello world program produce 50 errors!!
« on: November 29, 2017, 06:32:34 pm »
Just installed code::blocks with mingw included and set up the compiler and debugger things..

when i created a new project and compiled the hello world program following errors came up with wctype.h opening

This is the program
Code: [Select]
#include<iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    cout<<"I am bored.";
    return 0;
}


here are the errors
Code: [Select]
||=== Build: Debug in hello world (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|67|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|68|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|69|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|70|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|71|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|71|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|71|error: expression list treated as compound expression in initializer [-fpermissive]|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|72|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|72|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|72|error: expression list treated as compound expression in initializer [-fpermissive]|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|73|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|74|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|75|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|76|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|77|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|78|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|79|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|80|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|84|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|90|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|91|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|157|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|112|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|113|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|114|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|125|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|126|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|127|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|128|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|297|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wchar.h|308|error: 'wint_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|139|error: '::wint_t' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|141|error: '::btowc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|142|error: '::fgetwc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|144|error: '::fputwc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|149|error: '::getwc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|150|error: '::getwchar' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|155|error: '::putwc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|156|error: '::putwchar' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\cwchar|161|error: '::ungetwc' has not been declared|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|311|error: 'wint_t' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|353|error: 'int_type' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|356|error: 'int_type' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|361|error: 'int_type' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|361|error: 'int_type' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|364|error: 'int_type' does not name a type|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++\bits\char_traits.h|368|error: 'int_type' does not name a type|
C:\TURBOC3\INCLUDE\ctype.h|24|error: conflicting declaration 'char _ctype []'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\wctype.h|99|note: previous declaration as 'short unsigned int _ctype []'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\pthread.h|246|error: 'pid_t' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\MinGW\include\pthread.h|247|error: 'pid_t' was not declared in this scope|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|



I searched the google and forum for about 2 hour before posting here and can't any thing related to the problem.
If it I am posting it at the wrong place please tell me the right course.
And I am a almost a complete noob at this.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1585
Re: Even the default hello world program produce 50 errors!!
« Reply #1 on: November 29, 2017, 06:52:40 pm »
I think you use the .c file extension for your main file. You have to use the .cpp file extension if you are using c++. Codeblocks decides with the file extension if he should call the c or c++ compiler.
If you have compiling errors please follow the steps described here: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (specially the build log)
This will help us to help you.