int main (int argc, char *argv[])
{
return 0;
}
Still, the error occurred. I tried running it through a debugger, and I didn't really get anything (Stupid Dev-C++...). Does anybody know why this might happen?
🔒 Locked
Odd problem...
Advertisement
Original Post
I have an odd problem. I'm writing a simple RTS game for 4e4, and every time my game quits, it causes an access violation. I tried commenting out my entire main file, so that I was left with this:
...it could be something weird like not rebooting your machine in a long time.
Just for fun try main() without any parameters, and also try with void as return type; see if these make any difference.
Just for fun try main() without any parameters, and also try with void as return type; see if these make any difference.
Also, try stepping through the code (I realize it's just one line), and when the crash occurs see the stack-trace. Perhaps you will see more information.
1. I removed all #include<> commands as well, so it can't be from that.
2. I'll try main() without any parameters, but since I'm using C++ I may get an error from declaring it void instead of int. And I reboot my machine every night (it boots up rather quickly, it's a laptop so it has to). Also, the error happens on every computer that I test it on.
3. I know that the error occurs when I return from the function. If I omit that, it may fix it, but then again I'll probably get errors and warnings. I'll try that, though.
2. I'll try main() without any parameters, but since I'm using C++ I may get an error from declaring it void instead of int. And I reboot my machine every night (it boots up rather quickly, it's a laptop so it has to). Also, the error happens on every computer that I test it on.
3. I know that the error occurs when I return from the function. If I omit that, it may fix it, but then again I'll probably get errors and warnings. I'll try that, though.
It can't be globals, because I only have 5 globals in my program, and they're all integers. The main objects are all created in main().
Have you tried a full rebuild?
Never mind. Solved it on my own. Turns out it was a global deconstructor (there was a global that I thought was a member variable. A plague on my bad eyes!).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement