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
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    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,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 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, 21:37
  2. Replies: 5
    Last Post: 17th September 2012, 15:46
  3. Replies: 7
    Last Post: 30th August 2011, 00: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, 03:05
  5. Replies: 9
    Last Post: 15th April 2009, 07: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.