我開始惹Qt,並且在IDE中編譯項目時沒有問題。命令行是一個不同的故事。 Qt Creator很酷且全部,但我需要自動化我的構建。無法在Windows命令行中編譯任何Qt項目,只能在Qt Creator中編譯
它不會比這得要簡單得多:
untitled.pro內容:
SOURCES += \
source.cpp
source.cpp內容:
int main()
{
return 0;
}
在編譯輸出,它顯然是這樣做的:
C:\Qt\Qt5.5.1_x64\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
所以,我打開的CMD.exe,並運行以下命令:
C:\MyProjectDir>C:\Qt\Qt5.5.1_x64\5.5\msvc2013_64\bin\qmake.exe
這讓我調試,發佈,.qmake.stash,Makefile文件,Makefile.Debug和Makefile.Release文件和目錄。
接下來,我跑:
C:\MyProjectDir>C:\Qt\Qt5.5.1_x64\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
我總是收到此錯誤:
LINK : fatal error LNK1104: cannot open file 'shell32.lib' jom: C:\MyProjectDir\Makefile.Debug [debug\untitled.exe] Error 1104
我在做什麼錯?我也給了nmake一個鏡頭,但那也沒用。我寧願用jom。
對於這個特定的項目,它的使用msvc2013_64-5.5.1預comp'd安裝
編輯:由於NMAKE在評論中提到,這裏是NMAKE錯誤輸出:
LINK : fatal error LNK1181: cannot open input file 'shell32.lib' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.EXE"' : return code '0x49d' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\nmake.exe"' : return code '0x2' Stop.
只需在執行qmake之後輸入'make'即可完成任務。 –
它沒有。我在我的答案的底部解釋了這一點。 –
沒有選中,但對我來說工作正常。 –