Qt does not find the .exe file



  • Hi everybody,

    When I try to run my app on desktop I got the following error:
    Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug\FinalDemo.exe does not exist.

    I looked on the foldier and I found the .exe file in the debug folder, so in the path :
    Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug\debug\FinalDemo.exe

    If I manually move the file into the previous path, I can run the app on Qt creator. But as soon as I change something (add new code) and run it again, it automatically creates a new .exe file inside the \debug folder and when running again the app, it uses the previous .exe file, the one I moved manually (whitout the changes).

    This only happends when I also run the app on an Android Emulator.
    If I start a project and only run it on desktop, I dont have this problem.

    Hope there's a way to fix this, if not I have to move the .exe file everytime I made a change on the code.

    Thank you.


  • Moderators

    @CDS95

    Hi and welcome to devnet forum

    It looks a bit like mix up things here.

    @CDS95 said in Qt does not find the .exe file:

    When I try to run my app on desktop I got the following error:
    Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug\FinalDemo.exe does not exist.

    I looked on the foldier and I found the .exe file in the debug folder, so in the path :
    Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug\debug\FinalDemo.exe

    All above refers to the compiled application which can run on windows only. That looks fine besides the fact that you might have removed the drive letter for posting. Otherwise if "Workspace" is an environment variable, I am not sure if this is always handled properly. I would suggest to use a hardwired drive letter to pinpoint the problem.

    If I manually move the file into the previous path, I can run the app on Qt creator. But as soon as I change something (add new code) and run it again, it automatically creates a new .exe file inside the \debug folder and when running again the app, it uses the previous .exe file, the one I moved manually (whitout the changes).

    That correlates that there might be a drive letter issue as noted above.

    This only happends when I also run the app on an Android Emulator.
    If I start a project and only run it on desktop, I dont have this problem.

    With Android you will not have an exe as result. So if the problem is when you somehow activate Android Emulator. There might be a misunderstanding.

    Therefore, please clarify where (OS?) you like to run what (windows exe or Android app?).



  • Hi, thank you for your answer.

    • the full path is C:\Users\Jaime.Prohens.EXT\Documents\Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug
      And I am using Windows 7

    • I did some more test and here's the problem:
      Every time I run the app on Android emulator (I start the emulator on Android Studio ) it works prefectly. But when I swicht to "Desktop Qt 5.9.5 MinGW 32bit" to run it again on desktop, I have the "can't find .exe file". I figured out that closing Qt and opening it again fix the problem, because Qt automatically changes the exe path to C:\Users\Jaime.Prohens.EXT\Documents\Workspace\build-FinalDemo-Desktop_Qt_5_9_5_MinGW_32bit-Debug\debug

    Do I have to close and open again Qt every time I switch from android to desktop?

    And I forgot to say that the main goal is to build the app for desktop AND android


  • Moderators

    @CDS95

    I assume you are using Qt creator as IDE and switch in the lower left the tool chain.

    It may help when you rerun qmake (right click on project and "run qmake") when you have switched. Eventually rebuild too.



  • @koahnig

    Yes, I am using Qt creator as IDE and I switch to android compilation/running on the lower left chain as you said.
    I already tryed to run qmake qhen facing this problem and rebuild the app, but it doesnt fix the issue.

    As I mentioned in the last post, the only way to fix this problem is by closing Qt creator and start it again.


  • Moderators

    @CDS95

    You can check on JIRA if there is a bug report. Or file one yourself.

    You can also check on android-qt google group, if someone experienced the same problem.



  • I can actually confirm that behaviour in my installation of CtCreator 4.6 one on Windows 10, on Ubuntu,and on MacOs this works fine.

    I haven't checked on the bugtracker jet, i find it difficult to search for specific bugs.

    I think this may just be an oversight, because, IIRC, Windows is the only OS where qmake creates a debug and release folder each inside the actual debug and release path.


  • Moderators

    @J.Hilk

    the differentiation between debug and release is IIRC as well a windows issue. But that shall be cured by rerun of qmake. At least in my cases it cures, but I am typically switching between debug and release and applications only. The change of tool chain is not done often.

    I thought I am the only having trouble to get an overview on JIRA. Probably it would improve by daily use, but that is not the point for standard users.


  • Qt Champions 2017

    @koahnig and @J-Hilk:

    Regarding the extra debug and release folders I asked two years ago: https://bugreports.qt.io/browse/QTBUG-52347

    The workaround is to set CONFIG-=debug_and_release in the project file, and to take care to use shadow building because debug and release objects cannot be mixed on Windows.

    I added this option to all my projects and didn't see problems with that so far.



  • @aha_1980
    Well, thank you, that defenitly fixes the issue for me.


  • Moderators

    @aha_1980

    Not really sure if this will an issue for me.

    Can you freely switch forth and back with the left pane for compilation selection (debug/release) and the project is compiled as required?
    Maybe it does?


  • Qt Champions 2017

    @koahnig said in Qt does not find the .exe file:

    Can you freely switch forth and back with the left pane for compilation selection (debug/release) and the project is compiled as required?

    Yes. And I can also switch betwenn MSVC and MinGW.


Log in to reply
 

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