【Qt】运行报错Could not create directory “E:\xxxx-Debug“
一、現(xiàn)象
在本地打開一個(gè)其他工作站上的Qt工程,按運(yùn)行提示錯(cuò)誤信息如下:
21:30:20: 為項(xiàng)目timer執(zhí)行步驟 ...
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.
二、分析
首先明確此錯(cuò)誤在run時(shí)觸發(fā),其次在run前的build階段出錯(cuò),接著是執(zhí)行qmake時(shí)觸發(fā),最后提示使用的kit是Desktop Qt 5.9.9 MSVC2015 64bit。
三、解決
3.1開發(fā)欄中切換至設(shè)計(jì)模式
如圖:
此處根據(jù)shadow build的path可以知道,在本地是使用5.9.9進(jìn)行build。
3.2打開文件夾目錄
可看到曾經(jīng)build過5.14.2版本程序且有發(fā)布release版本,因此確定是build版本問題。
3.3將shadow build關(guān)閉,使用本地環(huán)境重新build
3.4按F5嘗試運(yùn)行
運(yùn)行正常:
21:30:04: Debugging E:\program\qt\timer\timer\debug\timer.exe ...
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect 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: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
四、總結(jié)
在不同工作站上使用工程時(shí),應(yīng)首先注意版本問題,特別是在低版本打開高版本這種情況下極易發(fā)生各種兼容性問題。因此,能本地重新編譯就重新編譯,只要源碼沒問題就行。
另外,shadow build的作用是將build前后的代碼文件分隔開,使工程看起來更立體,方便源碼文件管理而已,默認(rèn)開啟。也有一種說法是可以使用一份源碼文件編譯出不同環(huán)境的文件。
?
總結(jié)
以上是生活随笔為你收集整理的【Qt】运行报错Could not create directory “E:\xxxx-Debug“的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在使用vue-video-player时
- 下一篇: 音乐播放小窗口html,jQuery+h