Windows showstopper: "Could not find qmake configuration file default. Error while parsing file. Giving up."
-
I just started working with Qt two weeks ago. I have a simple program working on Mac and Linux. I'm now trying to get it working on Windows, but I can't even get Qt Creator to successfully open a Example project on Windows.
Every time I try to import a project or example, It keeps giving me an error like:
Could not find qmake configuration file default.
Error while parsing file C:/Qt/Qt5.4.1/Examples/Qt-5.4/quick/controls/gallery/gallery.pro. Giving up.Please help! I don't know what to do.
I am running Windows 8.1 Pro (64-bit) with Visual Studio 2013 Update 4 (Community Edition). I installed Qt 5.4.1 open source from the web site using the offline installer "qt-opensource-windows-x86-msvc2013_64-5.4.1.exe". (I didn't pick the OpenGL version because I don't know what that means.)
This is a relatively clean Windows installation. I just did a new installation of Windows this week due to a total hard disk failure.
Below is the message I see when trying to open the "Gallery" example. Pretty much they all look similar. My project just shows the first 2 lines without all the following lines.
Could not find qmake configuration file default.
Error while parsing file C:/Qt/Qt5.4.1/Examples/Qt-5.4/quick/controls/gallery/gallery.pro. Giving up.Could not find qmake configuration file default.
Error while parsing file C:/Qt/Qt5.4.1/Examples/Qt-5.4/widgets/mainwindows/application/application.pro. Giving up.
QML module does not contain information about components contained in plugins.Module path: C:/Qt/Qt5.4.1/Tools/QtCreator/bin/qml/QtQuick/Dialogs/Private
See "Using QML Modules with Plugins" in the documentation.Automatic type dump of QML module failed.
Errors:
"C:\Qt\Qt5.4.1\5.4\msvc2013_64\bin\qmlplugindump.exe" returned exit code 3.
Arguments: -nonrelocatable QtQuick.Dialogs.Private 1.1 C:/Qt/Qt5.4.1/Tools/QtCreator/bin/qml
QQmlComponent: Component is not ready
file:///C:/Qt/Qt5.4.1/Tools/QtCreator/bin/qml/loadqtquick2.qml:1:1: plugin cannot be loaded for module "QtQuick": Cannot load library C:/Qt/Qt5.4.1/Tools/QtCreator/bin/qml/QtQuick.2/qtquick2plugin.dll: -
Okay, I got a little further. Rebooting my system seemed to let the process get farther. (Qt installer should tell you to reboot if this is a requirement.)
Now my problem is that the build log seems to be trying to call a tool called "cl" but it is not found.
-
cl
is the c++ compiler of Visual Studio. Make sure it's correctly recognized in the Tools->Options->Build&Run->Compilers and that it is selected in the kit you're using in Tools->Options->Build&Run->Kits. Also make sure your Visual Studio installation is ok.cl
should be located in<VS installation dir>\VC\bin
directory.If you copied this project from mac or linux make sure you didn't copy the .user file too, and if you did close Creator, delete that file, reopen Creator and select the right kit again.
-
Thanks. So Qt was finding Visual Studio correctly. And I know Visual Studio is installed correctly because I can do non-Qt projects just fine.
I found a different thread on the internet about this problem. The problems seems to be that Qt assumes the cl.exe and all the environment is automatically accessible with the typical Visual Studio installation, but this is not true. The work around is instead of running qtcreator.exe directly, I must manually open cmd.exe, run vcvarsall.bat in my Visual Studio installation to set the environment in the cmd shell to have everything VS related loaded, and then run qtcreator.exe from the cmd shell which passes the environment along to qtcreator.
I wrote a little qtcreator.bat file to help me:
pushd "%dp0"
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
popd
: Use start to allow cmd.exe window to close
start qtcreator.exe -
That's... weird. To say the least.
I have several versions of VS and Qt installed at the same time and have clean environment i.e. nothing Qt or VS specific in PATH or other environment variables. This configuration works fine without any additional tricks like that.If you go to the Compilers tab in the Creator options and click on your compiler there's gonna be info shown below and in the section "Initialization" the path to vcvarsall.bat should be specified. Qt Creator uses it during the build so there should be no reason to run Qt Creator itself from VS-aware environment. Can you confirm that the path displayed there is correct?
-
I'm not sure its related but even on my fully working Windows 8.1 system with VS2013 installed and Qt installed for MSVC 32bit I will occasionally see the cannot parse the .pro file. By occasionally I mean that sometimes it just works, some times I have to monkey with the "run" portion of the project.
This usually results in the green arrow run and debug buttons being grayed out.
Usually what fixes that problem for me is to go to the "Projects" tab, select "Run" and in Run Configuration I usually have to "Add" the executable again as a new configuration and suddenly everything starts to work.
-
That's... weird. To say the least.
I have several versions of VS and Qt installed at the same time and have clean environment i.e. nothing Qt or VS specific in PATH or other environment variables. This configuration works fine without any additional tricks like that.If you go to the Compilers tab in the Creator options and click on your compiler there's gonna be info shown below and in the section "Initialization" the path to vcvarsall.bat should be specified. Qt Creator uses it during the build so there should be no reason to run Qt Creator itself from VS-aware environment. Can you confirm that the path displayed there is correct?
@Chris-Kawa
Under the Compilers tab, I have a section called Auto-detected
In there are the following:Microsoft Visual C++ Compiler 12.0 (x86)
Microsoft Visual C++ Compiler 12.0 (amd64)
Microsoft Visual C++ Compiler 12.0 (x86_amd64)
Microsoft Visual C++ Compiler 12.0 (x86_arm)
Microsoft Visual C++ Compiler 12.0 (amd64_arm)At the bottom, each has an initialization that says:
Initialization: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat x86
Initialization: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat amd64
Initialization: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat x86_amd64
Initialization: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat x86_arm
Initialization: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat amd64_armBy the way, I don't know what the last 3 variants mean. And I was using:
vcvarsall.bat x64 in my .bat file. (Though glancing at the vcvarsall.bat, it looks like x64 is aliased to amd64.) -
These seem fine. The last three are cross-compilation targets (they don't concern us here). Yes, x64 and amd64 params do the same.
Could you check one more thing? Start Qt Creator without your bat, open a project, go to Projects tab and click Details int ehBuild Environment section. There should be variable VCINSTALLDIR pointing to VC directory in your VS installation dir. Is it there and correct?
-
VCINSTALLDIR says C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\
This looks correct. But I still see all the old errors when I try opening an example app:
Could not find qmake configuration file default.
Error while parsing file D:/Qt/Qt5.4.1/Examples/Qt-5.4/quick/demos/calqlatr/calqlatr.pro. Giving up
... -
Weird. I hit the build button again (big green triangle on the left), but this time instead of repeating the error message I've always gotten before, it actually built and launched this time.
I really don't understand why it is working now, when it didn't before. I didn't change any settings.