Author Topic: Code::blocks console application problem under Vista  (Read 4093 times)

Offline alycosta

  • Single posting newcomer
  • *
  • Posts: 3
Code::blocks console application problem under Vista
« on: July 21, 2007, 09:23:34 pm »
Dear all,

I had to migrate to VISTA and now I am trying to set my code::blocks to run.

Following some threads found here, I could get the MinGW to compile. However, in a console application, the Vista gives me an error, something like:

"Your program stopped working" Windows is looking for a solution for your problem.

In the console, I get:


Process returned -1073741819 (0xC0000005)   execution time : 40.823 s
Press any key to continue.


Does anyone have any hints?

Thanks in advance,

Alysson

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Code::blocks console application problem under Vista
« Reply #1 on: July 21, 2007, 11:02:05 pm »
0xc0000005 is the Win-Error-Code for a Access violation.

This is probably caused by dereferencing an invalid pointer.

Dos this Programm compile and run correctly under another Version of Win / any other OS? I think ist is most probably an error in your source and not in Vista/MinGW but to make this sure you could supply some Code or try a Debugger.

Offline alycosta

  • Single posting newcomer
  • *
  • Posts: 3
Re: Code::blocks console application problem under Vista
« Reply #2 on: July 21, 2007, 11:05:12 pm »
Hi,

Yes... It compiled and ran ok under Windows XP.

It also happens that sometimes the error is in the middle of the execution and sometimes just in the very end (when exiting the main function).

Thanks,

Alysson

Offline balgior

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Code::blocks console application problem under Vista
« Reply #3 on: July 22, 2007, 03:56:16 am »
What MinGW version did you compile?
I remember when i changed to gcc 4.x.x (under linux though) it started complaining for things i had never seen in my application built with a previous version of gcc. The error messages were pretty similar to yours, but i don't remember the error code it produced. Later i found that it complained at runtime only, not when building, when my code reached to a point that was trying to release memory that had never been allocated!

stupid example  :shock::
{
    int* ptr;
    if(false) ptr = new int [10]; //never happens
    delete [] ptr; //error at runtime
} //or something like this...

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Code::blocks console application problem under Vista
« Reply #4 on: July 22, 2007, 09:42:09 am »
I think your code has a problem with delete vs. delete[] as delete for a NULL-Pointer is always defined and should never create an runtime-error.

Offline alycosta

  • Single posting newcomer
  • *
  • Posts: 3
Re: Code::blocks console application problem under Vista
« Reply #5 on: July 23, 2007, 07:26:11 pm »
Thanks again,

I went back to XP.  Something funny hapenned. The first time I compiled the same error appeared, and then, it stopped happening. There must really be some kind of "delete" error, but I wonder why it does not happen in XP.

I will reinstall the MinGW compiler and the nightly c::b and see what happens.

 

Offline balgior

  • Multiple posting newcomer
  • *
  • Posts: 24
Re: Code::blocks console application problem under Vista
« Reply #6 on: July 24, 2007, 06:09:38 am »
I think your code has a problem with delete vs. delete[] as delete for a NULL-Pointer is always defined and should never create an runtime-error.

Hmm... your suggestion leads me to a runtime error as well... try it! (gcc 4.1.2)
Anyway...