current position:Home>[Qt] Running error Could not create directory “E:\xxxx-Debug”

[Qt] Running error Could not create directory “E:\xxxx-Debug”

2022-11-24 23:07:55Evenurs

1. Phenomena

Open a Qt project on another workstation locally, and press Run to prompt the error message as follows:

21:30:20: Executing steps for project timer...
21:30:20: Could not create directory "E:\program\qt\timer\build-E:programqtu0009imeru0009imeru0009imer-Desktop_Qt_5_9_9_MSVC2015_64bit-Debug"
Error while building/deploying project timer (kit: Desktop Qt 5.9.9 MSVC2015 64bit)
When executing step "qmake"
21:30:20: Elapsed time: 00:00.

21:30:20: Executing steps for project timer ...21:30:20: Could not create directory "E:\program\qt\timer\build-E:programqtu0009imeru0009imeru0009imer-Desktop_Qt_5_9_9_MSVC2015_64bit-Debug"Error while building/deploying project timer (kit: Desktop Qt 5.9.9 MSVC2015 64bit)When executing step "qmake"21:30:20: Elapsed time: 00:00.

2. Analysis

First of all, it is clear that this error is triggered during run, secondly, an error occurs during the build phase before run, then it is triggered when qmake is executed, and finally it is prompted that the kit used is Desktop Qt 5.9.9 MSVC2015 64bit.

3. Solve

3.1 Switch to design mode in the development bar

As shown in the picture:

According to the path of shadow build, we can know that 5.9.9 is used for build locally.

3.2 Open folder directory

It can be seen that version 5.14.2 has been built and a release version has been released, so it is determined to be a problem with the build version.

3.3 close the shadow build and rebuild using the local environment

3.4 Press F5 to try to run

It works fine:

21:30:04: Debugging E:\program\qt\timer\timer\debug\timer.exe ...
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: knownincorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
21:30:07: Debugging of E:\program\qt\timer\timer\debug\timer.exe has finished.

21:40:54: Debugging E:\program\qt\timer\timer\debug\timer.exe ...
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: knownincorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

21:30:04: Debugging E:\program\qt\timer\timer\debug\timer.exe ...libpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profile21:30:07: Debugging of E:\program\qt\timer\timer\debug\timer.exe has finished.21:40:54: Debugging E:\program\qt\timer\timer\debug\timer.exe ...libpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profilelibpng warning: iCCP: known incorrect sRGB profile

Four. Summary

When using projects on different workstations, you should first pay attention to version issues, especially when a lower version opens a higher version, various compatibility problems are prone to occur.Therefore, recompile if you can recompile locally, as long as the source code is ok.

In addition, the function of shadow build is to separate the code files before and after the build, so that the project looks more three-dimensional, and it is convenient for source code file management. It is enabled by default.There is also a saying that you can use one source code file to compile files in different environments.

copyright notice
author[Evenurs],Please bring the original link to reprint, thank you.
https://en.chowdera.com/2022/328/202211242305595487.html

Random recommended