Results 1 to 4 of 4

Thread: binary was not built with debug information

  1. #1
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default binary was not built with debug information

    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.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,120
    Thanks
    235
    Thanked 656 Times in 646 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: binary was not built with debug information

    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.

  3. #3
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: binary was not built with debug information

    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.

    Quote Originally Posted by d_stranz View Post
    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: binary was not built with debug information

    Quote Originally Posted by hxf@dlut.edu.cn View Post
    Seems that the executable compiled by mingw can not be recognized by MSVC debugger
    That's what d_stranz said.

    Quote Originally Posted by hxf@dlut.edu.cn View Post
    Maybe an alternative way is to recompile the program by Microsoft visual studio compile
    That's also what d_stranz said.

    Quote Originally Posted by hxf@dlut.edu.cn View Post
    Thank you for your response.
    Maybe you should have read it?

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 20th July 2015, 20:37
  2. Replies: 5
    Last Post: 17th September 2012, 14:46
  3. Replies: 7
    Last Post: 29th August 2011, 23:37
  4. How to run a debug app linked against a release binary
    By rajji_saini in forum Installation and Deployment
    Replies: 8
    Last Post: 2nd March 2011, 02:05
  5. Replies: 9
    Last Post: 15th April 2009, 06:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.