我开始惹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'即可完成任务。 –
它没有。我在我的答案的底部解释了这一点。 –
没有选中,但对我来说工作正常。 –