0

I'm using Code::Blocks with the GNU GCC Compiler and when I try to include any library which has no '.h', like #include or somehow it gives an error on stdlib.h file...

It gives many errors some are:

c:\mingw\include\stdlib.h|90|error: '_BEGIN_C_DECLS' does not name a type
c:\mingw\include\stdlib.h|363|error: '__CRT_ALIAS' does not name a type
c:\mingw\include\stdlib.h|367|error: '__CRT_ALIAS' does not name a type
c:\mingw\include\stdlib.h|444|error: '_locale_t' has not been declared
c:\mingw\include\stdlib.h|447|error: '_locale_t' has not been declared 
stdlib.h|90|error: '_BEGIN_C_DECLS' does not name a type

However, I haven't even included the stdlib.h and I'm getting completly crazy! I've never used C++, I'm new to C and ws only testing the hello world, I've tried to install and uninstall Code::Blocks with MinGW. Does any one knows how to fix this?

My code:

#include <iostream>
using namespace std;

int main() 
{
    cout << "Hello, World!";
    return 0;
}

My file is .cpp, I have created a project and code::blocks's compiler on settings says: Selected Compiler: GNU GCC Compiler

And I selected the flag "Have g++ follow the C++11 ISO C++ language Standard [-std=c++11]". I'm running on Windows 10.

P. Duarte
  • 59
  • 1
  • 9
  • 1
    Have you created a C++ project? Have you given your C++ source file a.cpp extension? –  May 25 '18 at 13:14
  • 1
    did you chacked your compiler settings and selected project type? – JeJo May 25 '18 at 13:14
  • 2
    Are you compiling with gcc, or g++? gcc is a C compiler, and it is of no surprise, that you can't compile C++ code with it. – Algirdas Preidžius May 25 '18 at 13:15
  • Did you try to compile on the command line (then give the compilation command)?. BTW, your question should be tagged with your OS (probably Windows). – Basile Starynkevitch May 25 '18 at 13:15
  • The fact that you've gotten three comments asking for more information in the first four minutes your question has been here is a strong indication you've not asked a very good question.. You should [edit] it to provide much more detail. – Ken White May 25 '18 at 13:19

0 Answers0