Reputation: 2706
I have build a Qt project (qwt) using the vs2013 compiler in Qt creator. When I open the .pro file and look at the build steps I see:
When I build the project, all goes fine and the project is build without errors. So far so good.
However when I try to build this project using the command line I get errors during the nmake step. I have used the same commands as above (and I'm sure that I'm using the same versions of qmake/nmake).
...\QtCore\qglobal.h(38) : fatal error C1083: Cannot open include
file: 'stddef.h': No such file or directory
My question is, what does Qt do more so that the project does build in Qt creator and not from the command prompt? And how can I copy this behaviour in the command prompt? I'm doing this so I can make a batch file that builds the project (on a machine that does not have Qt creator installed).
Upvotes: 0
Views: 1440
Reputation: 8284
In order to use the Visual Studio compilation environment from the command-line you need to call the vcvars
batch script to set up the paths correctly.
Either call the vcvars64.bat
in the C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64
folder (that is for VS2013, you can replace the "12.0" with whatever visual studio version you have).
Or the vcvars32.bat
in the C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
folder.
Or use the vcvarsall.bat x86
or vcvarsall.bat x64
calls for the script in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
Alternatively Visual Studio creates shortcuts in the start-menu called along the lines of VS2013 x64 Native Tools Command Prompt
which call those scripts.
Upvotes: 3
Reputation: 11754
It's likely to be that Qt Creator
has added additional variables into the build environment, which are not presented when you try to compile manually through cmd
.
If you look within Qt Creator
under the Projects
section there's Build
information. Expand the Build Environment
information and check to see if there's anything in there different to your machines global environment settings.
Upvotes: 1