I am a complete beginner at C++ and I have been tasked to create a sudoku solver, I have written a partial sudoku solver but when I try to compile, I get a stack overflow error.
Are you using a C++98 or C++11 compiler? C++98 doesn't accept a string as an argument to open (lines 27, 51). Use filename.c_str() instead.
When you say you get a stack overflow, are you referring to the compiler, or to the execution of your program? Stack overflows in the compiler are rare.
Seriously, try and reduce the amount of data you're pushing onto the stack.
Try and eliminate lines 112-115. Perhaps create a struct for these items and push that struct onto a global std::stack each time you enter a level, and popping that stack when you exit out of a level. You're much more likely to be able to have enough storage for the maximum depth of your recursion using the heap instead of the stack.