Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Satch on January 29, 2007, 06:26:21 pm

Title: Puzzling Runtime error
Post by: Satch on January 29, 2007, 06:26:21 pm
I'm not usre I should post this problem in this forum but any help will be welcome.
I'm new to C/C++ programming so I followed all steps to the letter to intall both MinGW and CB in my system and I didn't get any error. I checked all paths and I'm quite sure everything is correctly installed and declared, but certainly I am missing something because I get a runtime error each time my program executes an std library function call.
The simpliest program with an std::cin or std::cout functions throws a runtime error:

#include <iostream>

int main()
{
   std::cout << "Hello world!" << std::endl;
   return 0;
}


The debug debugger output is:

Program received signal SIGSEGV, Segmentation fault.
In ntdll!RtlpWaitForCriticalSection () (ntdll.dll)


As I said I'm sure is my fault since program compile and link without errors neither warnings.
My guess is that I'm missing a #define or #if to ensure the code can run under Windows.

Oh, almost forgot:
OS -> Windows XP Professional Edition
CB -> svn build 3540

As I said, any help will be welcome.
Thank you.
Title: Re: Puzzling Runtime error
Post by: Michael on February 03, 2007, 08:31:57 pm
Hello,

Which version of GCC are you using? Did you install everything?

I think that the error is not related to your hello program, but to something else. I had one time a similar problem with ntdll.dll, but only on my notebook :(. On another one, my program worked fine.

May be you can try to build your program with another compiler and/or try it on a new machine.

Try also to search for information in google and/or in some C++ forums.

Best wishes,
Michael