Unknown bug - C++ debugging problem

Started by
3 comments, last by VB_master 16 years, 2 months ago
Hello everyone, I'm having troubles with my C++ console application. At some point the application simply crashes and I can't find the reason for such thing. I am using Dev-C++ 4.9.9.2 and I can't find a way to debug it properly. The only thing I found out while debugging was this window showing up when the application is about to crash. It doesn't crash every time I run it. Here is the screenshot: Bug Screenshot Please help. Thanks in advance! VB_master.
Every man dies, not every man really lives...Black Dawn Games
Advertisement
This doesn't really answer your question unfortunately, but why not use VC2008? DevCpp hasn't been updated in years, and if you get an access violation in VC2008, you get taken to the exact line that caused the problem, and a nice call stack showing you what calls were made up to that, right back to before WinMain / main.
I don't have VC2008 but I tried the code in VC2005. The application doesn't crash at all but I've got another problem. I get the error "error C3861: 'time': identifier not found" on the line

srand(time(NULL));

Why's that so?
Every man dies, not every man really lives...Black Dawn Games
Quote:Original post by VB_master
I don't have VC2008 but I tried the code in VC2005. The application doesn't crash at all but I've got another problem. I get the error "error C3861: 'time': identifier not found" on the line

srand(time(NULL));

Why's that so?
From the documentation:
Routine     Required headertime        <time.h>

Did you include time.h? And did you use angled brackets rather than double quotes?
Ah, thanks a lot. That solved the problem with srand and I found out what caused the first problem. Thanks!

VB_master.
Every man dies, not every man really lives...Black Dawn Games

This topic is closed to new replies.

Advertisement