PDA

View Full Version : binary was not built with debug information



hxf@dlut.edu.cn
19th March 2016, 11:32
Basic info: windows 8, qt creator + qt4.8 + mingw

Problem description: I can build my qt program well. But my released codes(debug mode) can not work well on another windows 7 machine, noted that there is no qt been installed on that win7 machine. On that win7 machine, when I close the qt application I can receive a "runtime error", this unusual issue happens occasionally/randomly. To this end, I used the Microsoft visual studio debugger to attach to the running qt application's process. The problem is that in the MS debugger, the qt executable can not be debugged because "binary was not built with debug information", as a result, I cannot see the codes, and can not do anything.

I want to use debug mode to generate a qt executable that can be debugged on another machine by Microsoft visual studio. I'm not trying to debug qt dlls themselves, just want to debug my own codes.

Hopefully, anyone can help. Thanks.

d_stranz
19th March 2016, 17:35
Code compiled with mingw (which is gcc / g++, basically) will produce debug information that is compatible with gdb, not MSVC. If you want to debug with MSVC, you must compile and link with it (including linking to Qt DLLS that were also built with it). In MSVC you cannot mix-and-match debug and release DLLs.

If you want to debug a mingw executable on a machine that does not have gdb installed, then you have to install it. Probably the easiest way to do that is to install Qt Creator on that machine.

MS Visual Studio 2015 has the possibility to install alternative toolchains, but I have no idea if this includes the mingw toolchain.

hxf@dlut.edu.cn
21st March 2016, 05:02
Seems that the executable compiled by mingw can not be recognized by MSVC debugger even though it can be attached by MSVC in windows. Maybe an alternative way is to recompile the program by Microsoft visual studio compile(maybe the terminology is incorrect). Thank you for your response.


Code compiled with mingw (which is gcc / g++, basically) will produce debug information that is compatible with gdb, not MSVC. If you want to debug with MSVC, you must compile and link with it (including linking to Qt DLLS that were also built with it). In MSVC you cannot mix-and-match debug and release DLLs.

If you want to debug a mingw executable on a machine that does not have gdb installed, then you have to install it. Probably the easiest way to do that is to install Qt Creator on that machine.

MS Visual Studio 2015 has the possibility to install alternative toolchains, but I have no idea if this includes the mingw toolchain.

anda_skoa
21st March 2016, 08:43
Seems that the executable compiled by mingw can not be recognized by MSVC debugger

That's what d_stranz said.



Maybe an alternative way is to recompile the program by Microsoft visual studio compile

That's also what d_stranz said.


Thank you for your response.
Maybe you should have read it?

Cheers,
_