I have been using Visual Studio Build Tools 2019 to compile a release version of my wxWidgets program (in conjunction with Code::Blocks) successfully for a while. The reason for using the C++ compiler available in Build Tools (as opposed to the compiler installed with Visual Studio Community/Express/etc, which is essentially the same) is one of legality as I would like to ultimately use the compiled executable in a commercial environment. I have been led to believe that the compilers themselves are less commercially restrictive compared with Visual Studio.
Up until now, whenever I need to debug the program, I compile the same code in Ubuntu (gcc) which again works fine. However, I would like to debug the program in Windows but am unsure how best to do this. I have so far managed to compile the debug shared wxWidgets libraries using cmake:
Code: Select all
nmake /f makefile.vc BUILD=debug SHARED=1 TARGET_CPU=X64 VENDOR=MYNAME MONOLITHIC=1 nmake /f makefile.vc BUILD=debug SHARED=1 TARGET_CPU=X64 VENDOR=MYNAME
Code: Select all
nmake /f makefile.vc BUILD=release SHARED=1 TARGET_CPU=X64 VENDOR=MYNAME MONOLITHIC=1 nmake /f makefile.vc BUILD=release SHARED=1 TARGET_CPU=X64 VENDOR=MYNAME
If I then try to simply run the debugged executable , I get a super horrible 'Debug Assertion Failed!' window error box appearing, informing me that 'wxbase30ud_vc_MYNAME.dll' 'cannot dereference string iterator because it is out of range (e.g. an end iterator). The actual offending line of code is in C:\Program File (x86)\Microsoft Visual Studio\2019\BuildTools\VC\MSVC\14.23.28105\include\xstring (line 1815).
My gut feeling is that in order to debug a program that has used the Visual Studio Build Tools compiler (cl.exe), one requires the Visual Studio Debugger, and that no matter how hard I try, gdb won't understand the debugging symbols,etc produced. However as the VS debugger is only available in Visual Studio Community/Express/etc, I won't be able to debug the program in Windows!
I know this is a bit off topic and perhaps not the right forum to ask such a question, but does anyone know if my gut feeling is correct? Or has anyone else managed to debug a Visual Studio compiled executable using an freely available debugger (such as gdb)?
Thanks for reading, and I hope my ramblings make sense!