I am developing an application (computer game) that will run on both Linux and Windows. My development is performed in Linux and for the Windows version I cross-compile in my Linux env using i686-w64-mingw32-g++. I would like the program to dump out the stack trace when it encounters a segmentation fault, I know how to do this for the Linux version of the program using backtrace but I am really struggling with how to do this on Windows.
I have looked at some examples suggestions here and here, but they seem to assume you are compiling your application code from a Windows platform, as they link dbghelp.dll when compiling (I assume you can't link dll files on Linux? Is there a mingw version of this dll?). I also tried using boost::stacktrace but that just prints gibberish on crashing in Windows.
Or am I going about this the wrong way completely? Basically I want to be able to dump a stack trace upon an error in the application (such as a segmentation fault) for the Windows version of the application but I am developing the application in a Linux environment.