g++.exe failure through Qt



  • I have Qt Creator 4.2.1 for use in developing C++ programs and GUIs. I like it but on my computer (as opposed to the Pi) I cannot build anything through it as I keep getting the error

    "g++.exe - Application Error"

    with the dialog

    "The application was unable to start correctly (0xc0000142)"

    and the IDE's command line itself reports the (probably the same) error

    [debug/Qt.exe] Error -1073741502

    I have been frantically googling and trying to fix the problem but nothing seems to be out there, before returning the usual solutions, I have MinGW, visual C++, etc AND other IDEs (such as CodeLite and Eclipse) all work.


  • Moderators

    @Hubbard

    Hi and welcome to devnet forum

    Did you check if the executable "Qt.exe" is available when you try to start the debugger?

    Your antivirus scanner may interfere here. I had the occassion that the AV-scanner was removing the freshly created exe when I started to access it. Also simple blocking might be an issue.

    Unfortunately, I have no experience with Eclipse or your CodeLite to understand about major differences.



  • Hello and thank you, I don't have a commecial antivirus program and I have Windows Defender disabled.



  • Also, I don't have a "Qt.exe" in the Qt directory?


  • Lifetime Qt Champion

    Hi,

    Why are you expecting a Qt.exe file in your Qt installation ?

    The application should be in the debug folder of the build tree (aka shadow build) from your project settings.


  • Moderators

    @Hubbard First thing I noticed is your error is about g++.exe, yet you don't list g++ as a compiler. From your list, mingw/vc++/etc I'm seeing you are on windows where there is no g++ (not entirely true, but you didn't list cygwin/g++).

    It sounds like you have something misconfigured in your Qt Creator and it is trying to use g++ instead of mingw or some other windows compatible compiler.


  • Moderators

    @Hubbard So, you installed Qt for MinGW? Did you installed MinGW provided with Qt? You should use the one provided with Qt - it is the easiest way on Windows to start to develop Qt applications.



  • @jsulm I did yeah, Qt did indeed come with MinGW with g++.exe in it, this is whats 'failing'
    @ambershark g++.exe is part of the MinGW (and others) package
    @SGaist There is no executable files in the build folder for my projects, is that a problem?


  • Moderators

    @Hubbard Try to call g++ in a terminal (use absolute path). Does it work?
    There is no executable because the compiler could not be executed to create it.


  • Moderators

    @jsulm @ambershark

    I have three different MinGW version 4.91, 4.92 and 5.30 installed as they came with Qt versions 5.4 up to 5.8. All of the respective folders contain a g++.exe. I had never cygwin installed on this machine.

    @Hubbard Yes, that is your problem.
    My guess is that you have probably called your project Qt and therefore an executable called "Qt.exe" would be generated. This should reside in <something>/debug/Qt.exe in your case. If it does not exist, you need to find out why. It could be th virus scanner.

    Since you are using Qt creator, you can check on the left pane on Projects and sould see something with Build&Run on your main screen. Depending on your actual Qt creator version you should see and be able to check the "Build settings" and the "Run settings".
    In "Run settings" there you can find the actual name of the executable including the complete path. Check the location again.


  • Moderators

    @jsulm said in g++.exe failure through Qt:

    @Hubbard Try to call g++ in a terminal (use absolute path). Does it work?
    There is no executable because the compiler could not be executed to create it.

    I did not read this careful enough. That is certainly also an option.

    @hubbard
    A good idea is to check the complete setup of Qt creator and the kits as well.
    Go to "Tools"->"Options"->"Build&Run". The different tabs need to be checked for warning signs (yellow Triangle).


  • Moderators

    @koahnig said in g++.exe failure through Qt:

    I have three different MinGW version 4.91, 4.92 and 5.30 installed as they came with Qt versions 5.4 up to 5.8. All of the respective folders contain a g++.exe. I had never cygwin installed on this machine.

    I didn't realize that Qt did that. The normal mingw installs do not have a g++.exe, it is mingw32-g++.exe, etc. Learn something new every day! :)

    In my defense I really don't use windows much, cause it's yucky! :P


  • Moderators

    @ambershark
    no defense required. I had to check too. Just realized that there are apparently also the 64bit versions of compiler installed through Qt.
    You should try windows. It has the nicer crashes :P


  • Moderators

    @koahnig Lol! I use windows to play video games. ;)

    I write my apps cross platform so inevitably I'm at least building and testing on windows, but I spend so little time there that I don't have the immediate answers pop in my head like they do from posix OSes. :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.