Beginner Compiling samples
-
Strange, are you using the open source version of Qt?
According to "this article":http://doc.qt.digia.com/4.7/install-win.html, you need to compile Qt with the Microsoft Compiler first. Never done it myself before but I will do so in near future.
-
"This one is much better":http://qt-project.org/wiki/Building_Qt_Desktop_for_Windows_with_MSVC
-
Build the Qt framework only if you really need to build it, because you can find already built with VS 2010 binaries to install at the "download section":https://qt-project.org/downloads (look for Qt libraries 4.8.3 for Windows (VS 2010, 235 MB) ) also you will most likely need the Qt Visual Studio Add in, this will install the Qt menu in Visual Studio (scroll down on the same download page and you will find the download there)
//you can also find the source code for Qt framework - if you decide you need to build it yourself.
-
Missed that, too. I could swear that wasn't there... :-)
-
There's a further twist. I too had the error. I have Qt 4.8.3 and Qt Creator 2.6.0 installed on Windows Vista Premium.
I believe the problem exisits for those who wish to compile Qt projects from within Qt Creator, which ever compiler you choose.
For compiler, I tried windows MinGW 4.4.0 then MS Visual Studio Express 2010 C++ compiler, on each loading the compiler settings into the Qt Creator Tools->Options->Build & Run->Kits->Compiler and Compiler and CMake settings.
In both cases I used the code from the Qt 4.8.3 examples dir and building gave the error:
The process "C:\Qt\qtcreator-2.6.0\bin\jom.exe" exited with code 2.
I found the reason was there was no Makefile generated because qmake was not run within Qt Creator build configuration. I tried adding it prior to the compile command but to no effect.
I added the qmake.exe path to $PATH in the Build Environment but no good.
I added the same to the CtrlPanel->System->Advanced Settings->Environment->PATH
I could then run qmake from a command prompt, generate the Makefile. I could compile from within Qt Creator then, but not run. I could however run the example executable I'd built from the command-line prompt.
Hope this helps. I'm quite a fan of Qt, but more so with the Linux installations which seem to run out of the box. The windows installation should do the same and bundle whatever it needs IMOP.
-
I should add the MS Visual Studio Express 2010 C++ is free but as the plugin for Qt Creator doesn't work with the Express edition the compiler doesn't seem to call qmake automatically within Qt Creator.
I will continue to investigate. The MinGW route may not require a plugin to call qmake but this all shouldn't be necessary IMOP. -
Intriguing. The user environment variable $PATH C:Qt\4.8.3\bin seems enough to allow me to re-build and run the example project from within Qt Creator. Doing the same inside Qt Creator build environment didn't work, so the plugin isn't needed if you use Qt Creator and not MS Visual Studio. Hope this helps.
-
@Boysie: I can not follow your description of the problem you ran into.
You mention cmake... what has that to do with anything? If you set up a cmake project then creator will of course not run qmake as that is a completely different build system. Creator will make sure the Qt binaries are in the PATH whenever it runs anything. So far I never got any complaints that this fails to work, you are the very first. So what exactly are you doing? What kind of project is it? Did you open it via a CMakeLists.txt file or a whatever.pro file?
Yes, development on Linux is much simpler than on Windows, I fully agree with you there. We can not ship the MS tools for building software for legal reasons. There is no way around that. We did put the mingw tools into the Qt SDK, but IIRC don't do so in the stand-alone Qt Creator installer. That is supposed to be as small as possible... people do complain about the download sizes when we include extra stuff, especially those that have a mingw set up already.