Project program works differently on different systems.

I'm doing my final project for my Intro C++ course in which I have A's and extra credit up until now. The project was due last Friday, but I was given an extension to present this Friday instead. My problem is that there are three computers I use to work on this. One at home, one in class, and one in the lab. And on each one the program works differently. Everything that was working when I left the lab is now broken. Everything I fix at home doesn't work in on the class computers. I'm using the same compiler and IDE (CodeBlocks with mingw compiler, from my external drive). I can't get this finish because I have to re-write a lot of code for each system. The code always compiles, but the program never functions as well as it did on the last computer.

Advice?
Sounds like undefined behaviour. Look out for out of bound array indices, dangling pointers, uninitialized values, etc.

If it's a simple mistake the compiler might be able to help you if you just turn up the warning level. With MinGW/GCC you should at least use the -Wall compiler flag. https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Otherwise using a debugger could probably help. I strongly recommend valgrind, it has helped me many times sometimes finding problems I didn't even know I had, but unfortunately it's not available on Windows.
Last edited on
Topic archived. No new replies allowed.