'Run button is disabled in Qt Creator

This happens even on a freshly created, empty project.

The Run (and also Debug) buttons are disabled for the Qt5 configuration (they're enabled for the Qt4 configuration). The build button is not disabled, however, and it works - I can build the project, but I can't run it from Qt Creator.

They are disabled in the Build menu as well. Everything is enabled and works fine for the Qt4 configuration, however.

It's a Qt/C++ project, on Windows 7 (32-bit).

enter image description hereenter image description here

Edit:

I found a couple of related questions - RUN button no enable in QtCreator for QML project and http://qt-project.org/forums/viewthread/15737, but they have slightly different circumstances, and they don't show a clear solution. I'm posting them in case they help, though.

Edit 2:

I checked the run configuration for Qt5, as suggested by @Blueman and @Fabian, and the executable field is empty (and also disabled), even though the Build configuration correctly specifies the path. Moreover, I get this error - "The .pro file untitled2.pro could not be parsed." Here's a screenshot:

enter image description here



Solution 1:[1]

I installed QtCreator 2.8.1 for test purposes and compile some project with Qt4.8.6 and Qt5.3

Result is the same as your, there is a disabled run button for Qt5 configuration and a parse problem with .pro file. Probably it's a bug.

My suggestion is to change QtCreator to latest version (everything works fine for me).

You don't have to reinstall whole qt environment, just install last QtCreator (link). It will be a separate application so you can also use the old one if needed.

Only problem is that the new installation (by default) use the same localization of settings as the old one. This may cause a problem.

I solved this by changing the default path of settings for new installation. After installation (don't run !) create on desktop (or somewhere else) a shortcut for application, right click -> properties. Under the shortcut tab, you will see an area that says Target, add at end:

-settingspath path

where path is place where setting will be placed.

for me it look:

C:\Qt\Tools\qtcreator-2.8.1\bin\qtcreator.exe -settingspath C:\Qt\Tools\qtcreator-2.8.1\settings

If new installation don't recognize both qt version and you don't know how to add it - just ask, I will add additional description.

[EDIT]

I found related question, the same problem, update of QtCreator was a solution.

Solution 2:[2]

I am on Qt Creator 3.6 and it still happens. The run button is disabled after project is build. The only solution is to restart Qt Creator.

Solution 3:[3]

Open the projects .pro file and make some arbitrary modification and save the changes. This will cause the .pro file to be re-parsed and for whatever reason will re-enable the run button.

I haven't seen this in a good couple of months but it used to plague me! Personally I would remove a random line from the .pro file, save it, re-add the line I removed the save it again. Worked every time!

Solution 4:[4]

I had same problem but in a bit different situation. However solution might be suitable for more people.

When in a debug edition of the project (this is important) I added a header file using Right Mouse Button on a project >> Add Existing File, I could not run the project. I could clean, (re)build but not run. The file was correctly added to .pro file. It did not matter whether I included the file anywhere in code (using #include instrution) or not.

If instead I clicked Right Mouse Button >> Add New ... >> C++ >> C++ Header File and pasted the code there, then I was able to run the project (obviously also clean, (re)build, run).

Solution is: change build edition to release, rebuild, and then switch to back debug.

Here is how I found solution to that. It happened to me at first on Windows 7 with Qt Creator 3.3.1 Opensource version. On Windows 7 the build bar always finished at 100% and in green what misled me. I opened the same project under Kubuntu 14.10. On Kubuntu Qt Creator showed me build bar in orange/red and displayed [4 Compile Output] as follows:

12:07:12: Running steps for project Threads02... 12:07:12: Could not create directory "/home/oskar/share/build-Threads02-Desktop_Qt_5_4_1_GCC_32bit-Debug" Error while building/deploying project Threads02 (kit: Desktop Qt 5.4.1 GCC 32bit) When executing step "qmake" 12:07:12: Elapsed time: 00:00.

It is not so indicative in itself. But the fact that very same project showed build errors on a different platform made me go back to Windows 7 and take a look what is there under [4 Compile Output]. And there were 2 things that I noticed:

... Could Not Find C:\Users\me\Documents\build-Threads02-Desktop_Qt_5_4_1_MinGW_32bit-Debug\debug\main.o ... Could Not Find C:\Users\me\Documents\build-Threads02-Desktop_Qt_5_4_1_MinGW_32bit-Debug\release\main.o ...

The "release" word made me think that Qt Creator changes few flags regarding build edition (but not all). So I switched build edition to release (sets all flags to release), rebuild and back to debug edition (sets all flags to debug again) - it makes everything work fine. It's always repeatable by me. Of course switching just to release mode also makes the problem go away as obviously it sets all build edition flags to sensible values.

Solution 5:[5]

Is it possible that the executable path in the run configuration of your project is incorrectly set?

I had this problem once. The default executable path was incorrect for some reason (QtCreator weirdness). After adding a manual executable path with the proper content the problem was fixed.

Solution 6:[6]

I'm using Qt Creator 3.3.2 and Qt 5.4. I encountered this problem after adding a new class. The solution was simple:

  1. Clean All
  2. Manually delete make files
  3. Restart Qt Creator
  4. Run qmake
  5. Build all

Although I didn't test it, it's possible that simply restarting Qt Creator is sufficient.

Solution 7:[7]

I have also had this on Windows due to the limit on the number of characters in a path. The shadow build by default is quite verbose, and can easily max out the path limit.

Changing the shadow build to e.g. build or build_ resolved this for me.

Solution 8:[8]

I had same problem on iPad mini 2. I created new project from Xode (blank project from template) and deployed it to iPad. After that Run and Debug buttons in Qt creator was enabled and I am able to deploy to iPad from Qt creator.

Solution 9:[9]

Try to change or add the startup configuration, it will help to update the paths and settings. You now:

Run configuration: untitled-2

Solution 10:[10]

It is most probably due to lack of Run Setting/Run Configuration. I have it set and the problem is solved.

See the link at: https://doc.qt.io/qtcreator/creator-run-settings.html, check the section Specifying Run Settings for Qt Quick UI Projects for an example.

Solution 11:[11]

1 - Close Qt Creator
2 - Delete project.pro.user file (not project.pro)
Note: if you have user setting then backup them because user settings will be lost
3- Re-open Project from project.pro
4- Re-setup your project
5- Enable Run and Debug Button.

Solution 12:[12]

I just encountered a similar issue with the AUR package of the Qt Creator on arch linux.

The solution was to download the original installer from the qt website and execute the .run file (After you made it executable):

https://www.qt.io/download

You are welcome :)