Important: Please read the Qt Code of Conduct -

Cannot debug using eclipse with mingw

  • When I try to debug my program I get:

    'no source available for "main()"'

    As the headline states I'm using Eclipse with mingw.

    So far I've been developing without being able to use the debug view.
    This is of course not optimal.

    Do you have any experience with this? Or do you just have an idea what it could be?

    Thank you for your time!

    EDIT: By the way - in my debug window, I see that my application was terminated with this:

    <terminated> MinGW gdb ... (Exited. Exit code = 0.)
    <terminated, exit value: 0>C:\MinGW\bin\gdb.exe
    <terminated, exit value: 0>D:\MyWorkspace\MyApplication\debug\myApplication.exe

  • I just got a new computer, and I'm trying to make a fresh installation of my development environment. The goal is to be able to develop Qt applications in Eclipse.

    When I install Qt OpenSource 4.7.4, I get a notification saying that the installed MinGW version is not supported.

    I've tried to ignore this and finish the installation. I am still not able to debug after this. Could this be caused by the versions not matching?

    I am now trying to reinstall Qt OpenSource 4.7.4. I have also changed MinGW to the supported version (I'm not 100 % sure that I did it correctly. I downloaded from: . Here I got 2 folders "include" and "lib". I moved them to the MinGW folder overwriting the "old" files).
    Now I get a new notification saying that the "g++ version found does not match 4.4.0 (Found version 4.6.1)"

    As mentioned I'm not sure this has anything to do with me not being able to debug my Qt application in Eclipse.

    Do you have a suggestion?

    Thank you for your time!

  • I could really use some help :(

    I started over again. I installed:

    Eclipse 20110916-0149 Indigo
    CDT 8.0.1 for Eclipse Indigo (TCF was not installed)
    MinGW 4.5.2
    Qt OpenSource 4.7.4
    Qt Eclipse Integration 1.6.1

    FYI I'm running on windows 7 32 bit.

    When using Qt Creator, I am able to debug. It seems to be working as intended. Yes, I know that you might think "then just use that instead of Eclipse", but it bothers me that I can't get it to work. I like working in Eclipse and would like to stay there.

    Thank you for your time!

  • Sorry to say that, but forget about debugging Qt applications with eclipse. We use eclipse + MinGW for more than 2 years for Qt development but for debugging we always launch QtCreator. I know, it is not a perfect solution, but the QtCreator debugger is so much better than the eclipse DSF debugger for the following reasons:

    1. it simply works
    2. startup of a debugging session is much faster than in eclipse (especially if you work with a lot of DLLs)
    3. it is not possible in eclipse to set breakpoints in DLLs before they are loaded
    4. it is not possible in eclipse to interrupt a running Qt application from the debugger
    5. QtCreator supports pretty printing of a lot of Qt data types that makes debugging much more eficcient

    Because QtCreator only needs the projects .pro file it is quite easy to share a project between eclipse and QtCreator. And starting up QtCreator and launching a debug session is much faster than simply launching a debug session in eclipse (for large projects).

  • Thank you for your reply Uwe!

    I guess I will do as you suggest.

    it would be nice to be able to stick to only one IDE, but this will have to do :)

    thank you once again.

Log in to reply