DevC++ forcing terminate

On one of my functions, I have declared an object. I access it again towards the end of the function. When I try to compile the code, it tells me the object has not been declared in the scope

What's weirder, if I try to minimise the entire function, it will cause and error and force me to terminate the program

I have counted all of the curly brackets because I thought this must be the error if it isn't detecting the object, but there are 48 opening brackets, and 48 closing brackets. Has anybody had a similar issue like this before? And how did you fix it?
Last edited on
Hi,

Please post your code, so we can see whats going on.

Did you initialise your object?

Have you used the debugger?

If you have a problem with braces not matching, the compiler will catch that, sounds as though the program runs, so might not be that.

TheIdeasMan
What's weirder, if I try to minimise the entire function, it will cause and error and force me to terminate the program
Dev-C++ is crashing? Not just your program? That's weird. You could try to reinstall Dev-C++ or install another IDE and see if that works better.
Dev-C++ is crashing? Not just your program?


Yes, the Title of the Topic is not a good one. Hopefully garanon is not reinstalling as we speak !

TheIdeasMan
Well debug comes up with no error, but it still won't access the value I'm trying to
I did initialise the object at the start by the way, I can access the object earlier in the code

I don't think I should post my code since it's so big, but while I'm waiting for responses I'll work on making it smaller
Well I think I found the issue why I can't access the object (I initialised the object inside a loop instead of the whole function), but it still doesn't explain why DevC++ is forcing a terminate when I try to minimise the function
Hi,

You don't have to make your code smaller just for us, post only the bit or bits that have the problem.
Are you sure debug doesn't show problems? I very much doubt it. You use debug to track the variable and their values as you step throgh the code. If your program is crashing and you say debug doesn't show problems, then you aren't using debug properly.

Hope this helps
Actually, making the code smaller is a good idea. By doing so it is a great chance that you find the real problem and don't even have to show us the code.
I think Peter87 has a valid point. My code is unnecessarily large because I'm just playing around as a newbie. I think I should put all my objects into an array so I can use for loops to go through the different functions which will get rid of the repeat lines, and if I can't find the problem then I'll make a new thread.

It's just that I have two separate issues at the moment. One is what the thread was initially about, DevC++ forcing me to terminate my project when I try to minimise the function, and the other is that my function causes my actual program to crash (which I thought was related but apparently isn't)

So they are different issues causing crashes of different things.
I should fix at least one of them first before I come to you guys

Thanks a lot :D
Don't start a new thread, keep it all in this one. If there are 2 threads about the same thing, it just confuses things.

Getting rid of extraneous stuff is a good idea.

What do you mean by this exactly?

DevC++ forcing me to terminate my project when I try to minimise the function


How are you going with the debugger?
Topic archived. No new replies allowed.