Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Path to the executable points to debug version in release mode with Qt Creator 4.12.4



  • I built a cmake project in debug and release versions using Qt Creator and Visual Studio 2015 cmake generator. In debug version, path to the executable (set automatically by QtCreator) is set to projectpath_Debug\DEPLOY\bin\Debug\projectd.exe and the working directory to projectpath_Debug\DEPLOY\bin\Debug which is correct.

    But in release mode, it points to the right build directory projectpath_Release but the path to the executable still tries to search Debug folder like projectpath_Release\DEPLOY\bin\Debug\projectd.exe and the working directory is set to
    projectpath_Release\DEPLOY\bin\Debug

    Problems:

    • Why is it searching for Debug folder in release build?

    • Changing the working directory in release mode to point to release projectpath_Release\DEPLOY\bin\Release changes the working directory for Debug configuration as well.

    • Checking the QtCreator variables/macros current values of the paths are all pointing to Debug folder and projectd.exe . Even in release configuration.

    PS: I am on Qt 5.7.1 with Qt Creator recently updated to 4.12.4 on Win 10



  • @MarKS I managed to find a temporary solution to generate and build successfully. Instead of using Visual Studio 2015 cmake generator i used NMake Makefiles Jom.

    Now, QtCreator identifies the executable correctly as the build doesn't create a debug or release folder inside the build folder for nmake i suppose. The path looks something like this projectpath_Debug\DEPLOY\bin\projectd.exe and projectpath_Release\DEPLOY\bin\project.exe for Debug and Release builds respectively.

    This should allow the user to at least get started on working with the project. But if someone is bound to use Visual Studio 2015 generator the problem still persists.

    PS: Changing the working directory in release mode to point to release projectpath_Release\DEPLOY\bin\Release changes the working directory for Debug configuration as well => STILL EXISTS!!! I have created a new thread for this issue.


Log in to reply