3
votes

I'm starting to mess with Qt, and I've had no issues compiling projects within their IDE. Commandline has been a different story. Qt Creator is cool and all, but I need to automate my builds.

It doesn't get much more simple than this:

untitled.pro contents:

SOURCES += \
    source.cpp

source.cpp contents:

int main()
{
    return 0;
}

In the compile output, it's apparently doing this:

C:\Qt\Qt5.5.1_x64\Tools\QtCreator\bin\jom.exe -f Makefile.Debug

So, I open CMD.exe, and run the following:

C:\MyProjectDir>C:\Qt\Qt5.5.1_x64\5.5\msvc2013_64\bin\qmake.exe 

That made my debug, release, .qmake.stash, Makefile, Makefile.Debug, and Makefile.Release files and directories.

Next, I ran:

C:\MyProjectDir>C:\Qt\Qt5.5.1_x64\Tools\QtCreator\bin\jom.exe -f Makefile.Debug

And I'm always getting this error:

LINK : fatal error LNK1104: cannot open file 'shell32.lib' jom: C:\MyProjectDir\Makefile.Debug [debug\untitled.exe] Error 1104

What am I doing wrong? I also gave nmake a shot, but that didn't work either. I'd rather use jom.

For this specific project, it's using the msvc2013_64-5.5.1 pre-comp'd installer

Edit: Since nmake was mentioned in the comments, here is the error output for 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.

1
Just type 'make' after executing qmake and that will do the job.Sudipta Kumar Sahoo
It doesn't. I explained that at the bottom of my answer.kayleeFrye_onDeck
Can you please update your complete ,pro fileSudipta Kumar Sahoo
@kayleeFrye_onDeck did you try with the Qt command line shortcut ?Ilya
As a side note in Ubuntu (or in Linux generally) you don't need to setup anything if Qt tools are installed from the package repositories. Everything works also in the command line out-of-the-box. This question is a perfect example why I prefer Ubuntu in Qt development.juzzlin

1 Answers

1
votes

Use (or imitate) the Qt command prompt ("Qt 5.x for desktop..." shortcut), it'll have the PATH you need set.