Omnimaga

General Discussion => Technology and Development => Computer Usage and Setup Help => Topic started by: Spyro543 on November 06, 2011, 06:29:38 am

Title: CodeBlocks IDE is not working...
Post by: Spyro543 on November 06, 2011, 06:29:38 am
I've been trying to learn C++, but with an IDE/Compiler that is refusing to work (or maybe I'm too n00bish to figure it out :P) it's kinda hard.
I set the default compiler to Cygwin GCC, set all the toolchain executables (C compiler -> gcc.exe, C++ compiler -> g++.exe), and typed in some code in my current project. It's just a very simple program:
Code: [Select]
#include <iostream>
using namespace std;
int main()
{
    int a = 5;
    int b = 6;
    a = a + 5;
    int result = a + b;
    cout << "The result is " << result;
    return 0;
}
(Also I think the numbering is broken on the code tags)
When I click Build and Run, I get a command prompt window with the following:
Code: [Select]
      4 [main] ? 2488 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
Exception: STATUS_ACCESS_VIOLATION at eip=77AA47E5
eax=00000000 ebx=00000000 ecx=00000000 edx=7EFDD000 esi=00000000 edi=00400000
ebp=0028EEA4 esp=0028EE70 program=, pid 0, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame     Function  Args
0028EEA4  77AA47E5  (00400000, 00000000, 00000000, 0028EEE8)
0028EEB8  77AA2C54  (00400000, 00000001, 0028EFC0, 6104F4A6)
0028EEE8  6109A582  (00400000, FFFFFFFE, 0028EEE4, 77AA317F)
0028EFA8  61004A78  (0028EFC0, FFFFFFFF, 0000EEEE, 0028F8B8)
0028FF58  6100594F  (00000000, 00000000, 00000000, 00000000)
End of stack trace

Process returned -1073741819 (0xC0000005)   execution time : 10.676 s
Press any key to continue.
And in the build log I get:
Code: [Select]
Checking for existence: C:\Users\Owner\Documents\C++Proj\C++ Experiments\bin\Release\C++ Experiments.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\Owner\Documents\C++Proj\C++ Experiments\bin\Release\C++ Experiments.exe"  (in C:\Users\Owner\Documents\C++Proj\C++ Experiments\.)
Process terminated with status -1073741819 (0 minutes, 52 seconds)
Anyone know what's wrong here? Any way I can fix it?
Title: Re: CodeBlocks IDE is not working...
Post by: harold on November 06, 2011, 08:00:03 am
Code::blocks has never done that to me..
I see nothing in the code that should cause an access violation, but just in case, could you post the disassembly?
Title: Re: CodeBlocks IDE is not working...
Post by: Scipi on November 06, 2011, 09:22:49 am
It compiled and ran. Try executing the binary and see if it gives you that error. It might be your compiler(?)

It the binary gives you the same result try another compiler like MinGW.
Title: Re: CodeBlocks IDE is not working...
Post by: Binder News on November 06, 2011, 09:44:35 am
Yeah, go with MinGW. It's a port of GCC to Windows, so it's not as complete as Cygwin, but I have never had any problems whatsoever with MinGW.