Qt Creator - Troubleshooting

This page contains a large list of common issues students have had when setting up and using Qt Creator. Consider searching this page using Ctrl+F (Command+F on Mac) to try to jump quickly to the text of the relevant error message or issue.

How to "re-initialize" a Qt Creator project:

About 90% of random Qt Creator issues we've seen can be resolved by re-initializing your project. Here are the steps to re-initialize a project. (Please note that these steps involve deleting some files from your computer. Be careful not to delete your assignment solution code. Make frequent backups of your files.)

  • Close Qt Creator.
  • Use your file explorer to navigate to the folder where your project is stored. Delete the .pro.user file that is there, such as Life.pro.user. (Note: Do not delete the .pro file, such as Life.pro; only the .pro.user file.) (screenshot)
  • Also delete the "build" folder for your project. This is located in the parent directory of your project's directory, and it usually has a long name like build-Life-Desktop_Qt_5_x_x_MinGW_32bit-Debug . Delete this entire build directory. (screenshot)
  • Re-open your project's .pro file in Qt Creator. It should ask you to "Configure Project".
  • Now try to re-compile and re-run your project and see if things work any better.


Q: Where should I put my project on my hard drive? Does it have to go in the C:\Qt folder with the Qt Creator application?
A: No; in fact, we strongly recommend putting it somewhere outside the Qt Creator directory. Put it somewhere inside your My Documents folder, or something like that.
Q: When I try to run my program on the computers on Windows in the LaIR or other on-campus clusters, Qt Creator crashes. Help!
A: Qt Creator sometimes doesn't like it when your project is stored on the network shared "AFS" space. In particular, your Downloads directory is a bad place to put a project. Instead try using your "U:" drive or the local "E:" drive to work on your project. Or reboot the machine into Mac OS X, which does not have this problem.
Q: When I double-click a .cpp file to open it, I can't Build or Run it. Those buttons are grayed out. What is wrong?
A: You need to open a project, not just a .cpp file. Choose "File" → "Open File or Project..." and navigate to the project's .pro file. Open that in Qt Creator and then from inside the project, open the .cpp source code to edit and compile it.
Q: When I try to open a project .pro file, on the "Configure Project" screen, the "Next" button is grayed out. It says there are "no kits available". I can't advance to working on the project or running it. What is wrong?
A: A "kit" is a C++ compiler. If Qt Creator thinks there are no kits available, you may have installed Qt improperly. A very common bug here on Windows is when you forget to check the checkbox labeled "MinGW 32 bit" during the Qt installation as was specified in our install instructions. Try reinstalling Qt Creator and making certain that you check this important box.
Q: Qt Creator has lots of yellow "warnings" that pop up all over my code. I am just following the code examples shown in class. Am I doing something wrong?
A: Recent versions of Qt Creator have added a feature called a "code model" that performs style checking on your code as you write it. This is sometimes useful, but we think the checker is too picky and gives warnings about code that is not dangerous. You do not need to remove these warnings from your program. If your program compiles and runs without errors, you should be fine.

If you'd like to modify your settings to make these unnecessary warnings go away, take a look at our Qt Creator Recommended Settings page.

Q: Normally the left side of the window shows my project and all of its files. But now, that entire area is missing or doesn't show my project any more. Where did it go, and how do I get it to come back?
A: If you see a drop-down box in that left area, click it and make sure it's set to "Projects". If you don't see any drop-down box or left area, click Window → Show Sidebar (or press Alt-0).
Q: When I try to compile my program I see an error message saying, "symbol(s) not found for architecture x86_64." It doesn't give a line number. What does it mean, and how do I fix it?
screenshot

A: This means that you tried to use a function you didn't define. Often this is because of a difference between the parameters or return type in the function prototype and function definition. To get more information about the error, click on the "4 Compile Output" tab near the bottom of the screen, and scroll up to find any relevant lines of error messages:

screenshot
Q: When I first load up a project in Qt Creator, I see the following error message. What does it mean, and how do I fix it?
Could not find qmake configuration file default.
Error while parsing file /Users/foobar/cs106b/Life/Life.pro. Giving up.

A: This is just a warning message that you should be able to ignore. If you are able to build and run the project, you don't have to worry about this message. Some students have reported that this warning goes away if you go to the Qt Creator Options → Build & Run → Kits tab, and then set one of your actual "kits" to be the default, not "manual" or "Desktop". But you shouldn't need to do this.

Q: When I try to compile my project, I see error messages similar to the following. What does this me and how do I fix it?
No rule to make / could not find ..........\debug\FILENAME.o

A: This sometimes means Qt Creator is confused about what files should / shouldn't be part of your project. Follow the steps to re-initialize your project.

Q: When I run any project in Qt Creator, the fonts are very small. I have a high-resolution screen (e.g. Retina display). How do I fix it?
A: Java JDK version 8 and lower do not properly scale their fonts for high-DPI (high-resolution) screens. Java 9 and up have much better font-scaling support. Try upgrading your Java JDK to Java 9 or higher to fix this issue.
(Windows-only) Q: I am able to compile the sample project, but when I run it, the console window does not pop up. The program just seems to freeze and sit there. What is wrong?

A: Usually this means that there is a problem with your Java JDK installation. Most commonly this occurs on a Windows machine when you have multiple versions of Java installed. The best fix is to uninstall all older versions of Java from your machine. Go to Control Panel → Programs → Uninstall Programs. In the list that pops up, scroll down to the "J" area and look for "Java". If you see multiple entries there, uninstall all of them other than Java JDK/SDK 1.8. (In particular, look for and remove "JRE" or "Java Runtime Environment" entries, and remove any versions of Java older than 1.8.)

If removing old versions of Java doesn't solve the problem, and you are using Windows 7 or higher, try the following advanced option. First, go figure out where exactly your Java JDK has been installed on your system. Look in C:\Program Files\Java or C:\Program Files (x86)\Java for folders whose names start with "jdk". In our example, the folder name is "C:\Program Files\Java\jdk1.8.0_60" , but substitute whatever your folder is called.

Once you have found out where Java is installed, open a Command Prompt (press the Windows key or Start button, then type "command prompt" and choose the first option that appears.) A black console window should appear. Into that window, type the following command and press Enter:

setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_60"

No output should appear when you press Enter. But now if you restart Qt Creator and re-run your project, it may be able to locate your Java JDK installation properly.

(Windows-only) Q: When I first open my project I see some error messages in the General Messages box. What do these messages mean and how do I fix it?
Running Windows Runtime device detection.
No winrtrunner.exe found.
Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
Error while parsing file C:\...\myproject.pro. Giving up.
Cannot read C:\...\.qmake.cache: No such file or directory
screenshot
A: These are spurious error messages; you can completely ignore them. Despite these messages, you should still be able to compile and run your project successfully.
(Windows-only) Q: My projects compile successfully, but when I try to run the project on Windows 8, I see this error message: "SHIMVIEW: ShimInfo(Complete) FTH: (712): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***" What does it mean?
A: It usually happens when you don't have Java installed properly. See the Java JDK installation steps above. Uninstall any old versions of Java on your system if necessary.
(Windows-only) Q: When I try to compile my program I see an error message, "cannot open output file ...\MyProgram.exe: Permission denied". What does it mean? How do I fix it?
screenshot

A: It means that your executable is still running from the last time you ran/tested the program a moment ago. Make sure to shut down any previously running instances of your program. You might need to open your operating system's Task Manager to stop them all. Also see the next FAQ item if you continue having this problem.

screenshot

(Windows-only) Q: The first time I try to compile my program, it works fine. But if I try to re-compile it a second time, I get the message, "MyProgram.exe: Permission denied". I am sure that I have closed all of my programs and tabs as described above. I am unable to delete the "build" folder as described above. When I try to delete, rename, or modify my program's compiled .exe file or build folder, I see a message, "You'll need to provide administrator permission to delete this folder". Even if I click the "Continue" button with the shield on it, it fails. It says I don't have permission to delete the file/directory, even though I created it myself. What is going on?

screenshot

A: Sometimes a Windows feature called "System Protection" locks your .exe programs so that they can't be modified. The fastest way to get out of this situation is to disable the System Protection feature. To do this, go to your Control Panel, and choose System. Now click the System Protection tab/link, which is either on the left or top side of the window. Depending on your version of Windows, either click the "Disable system protection" radio button, or if you instead see a list of disk drives, double-click on the drive where your project is stored (likely drive C:), and change the setting to Off.

screenshot
screenshot
screenshot

Another thing that can cause the "permission denied" problem is pesky anti-virus software. In particular we have seen that McAfee Anti-Virus places strong locks on all .exe files that stops you from modifying or deleting them. We have seen that Windows users who completely uninstall McAfee will see this behavior go away.

(Windows-only) Q: When I try to run my program I see a pop-up window with an error message saying, "Runtime Error!" and, "This application has requested the Runtime to terminate it in an unusual way." What does it mean? How do I fix it?
screenshot
A: This means that there's an error in your code (an unhandled exception, specifically). You'll need to enable Tools => Options => Debugger => GDB Extended => "Stop when abort() is called".
screenshot

To get more information about the error you need to run your code in a debugger. Instead of clicking on the green arrow (Ctrl + R) to run your program, click the green arrow with a bug on it (F5). When your program encounters the error which caused the problem in the first place, you'll be placed in a debugger looking at the exact moment the crash occured.

(Windows-only) Q: When I try to compile and run a project, I get errors related to an 'xcopy' command. For example, it might say, "Invalid number of parameters". What is going on?

A: We have seen this when a Windows user has installed certain applications that conflict with Qt Creator's features. Here is a partial list of problematic applications:

  • Cygwin
  • Git / GitHub
  • Rtools
  • Windows Services for Unix

Why are these apps problematic? In general it is because they install files that confuse Qt Creator. If you have any software on your computer that installs a file named bash.exe or sh.exe, this can mess up Qt Creator. The above apps do so.

Our suggested fix is that if you have any of the above programs installed, uninstall them and try again, or to use a machine that does not have that software installed.

Sometimes you can modify the offending software so that it will not conflict with Qt Creator, by removing or renaming the offending files. For example, if you install the Git version control system on Windows, you can use your file explorer to go to the usr/bin subdirectory of your Git folder (default is C:\Program Files\Git\usr\bin) and rename the file bash.exe to bash2.exe, and sh.exe to sh2.exe. Then try to compile your project again in Qt Creator.

(Windows-only) Q: When I try to run a project, it says that my executable "exited with code 255". I sometimes also see a message about "SHIMVIEW: ShimInfo(Complete)". What is going on, and how do I fix it?
A: We have seen this when a Windows user has an application called "Cygwin" installed on their system. Cygwin adds certain Unix/Linux commands to Windows, but it can interfere with some built-in Windows commands needed by our system. Our suggested fix is to uninstall Cygwin and try again, or to use a machine that does not have Cygwin installed.
Q: If I create a C++ project of my own, it builds and runs fine. But when I try the SampleProject or the Homework ZIP project, it builds successfully and then doesn't run. Why not?
A: This usually means you don't have Java JDK properly installed as described above. Follow the Java steps above to ensure that you do have Java.
Q: My program compiles, but when it runs I get an error like this one:
***
*** STANFORD C++ LIBRARY ERROR:
*** Unable to find the file 'spl.jar' for the Stanford
*** C++ library's Java back-end process.
*** Please make sure that spl.jar is properly attached to your project.
*** If you are trying to run a stand-alone executable, place spl.jar
*** in the same directory as your executable, or set the system
*** environment variable SPL_HOME to a directory path containing spl.jar.
***
*** (I looked for it in the following directory:)
*** /Users/MyName/Applications
***
What should I do?
A: Click on "Projects" in the left-hand window, and select the project that is having an issue. On the right side of the window, under "Run," click "Run in terminal." Then run the program once from the terminal (it should run fine). Go back and un-check that box, and it will run fine in the normal window after that.
(Mac-only) Q: When I try to install Qt Creator on my Mac, it says, "Cannot verify the identity of the developer." What is wrong?

A: Open up System Preferences (in your Applications folder), go to Security and Privacy, and click the lock in the bottom left (and enter your password). In the menu under "Allow apps downloaded from:", choose "Anywhere" and click the lock to save. Now, install Qt Creator. Once you're done installing, click the lock again, choose "Mac App Store and identified developers", and click the lock once more to save. Another fix: Instead of double-clicking the .dmg file when you install, right-click it and choose Open.

(Mac-only) Q: When I try to install Qt Creator on my Mac, it gets stuck with a progress bar labeled, Verifying "qt-opensource-mac-x64....". The bar gets stuck at about 2/3 done and doesn't move. What should I do?
screenshot

A: This seems to occur because the Qt Creator installer is a very large file (over 2gb in size), and on some older Macs that don't have a lot of RAM memory, the file can be too big to open. Some students have reported that if they let this box sit for a long time, such as about 30-45 minutes, it will finally finish. Another option is to instead use the Qt Creator Online Installer (go to the linked page, click "Go open source", Accept the license terms, then click "Download"), which is a smaller program that won't consume as much RAM memory. You can install it using similar options as described in our installation guide.

(Mac-only) Q: After I install Qt Creator on my Mac and open a project, I cannot build or run it. It says, "No valid kits found." What should I do?

A: This error can have one of several causes. The most common issue is that when you're installing Qt on Mac, on the "Select components" page, you need to expand the list of items and make sure MacOS is checked. (By default, it is not checked.)

screenshot

If you fail/forget to do this, the symptom is that there won't be any valid kits found. In that case, you'll need to remove the Qt Creator program from your Applications directory, delete any Qt folders from your home directory, then reopen the Qt Creator .dmg installer file and go through the installation process again. If you deleted the .dmg, you'll need to redownload it from the Qt web site.

Sometimes your Qt Creator initially works fine but then at a later date the "No valid kits found" error starts to appear. If this happens to you, first try quitting out of Qt Creator (Command-Q), then follow the steps to re-initialize your project. That may fix the issue.

On some systems you must manually select your compiler and debugger ("Kit") through the Preferences. From the Qt Creator app's top menu, click Qt Creator, then Preferences (or press Command-,). In the Preferences window, choose the "Kits" option on the left. Then under the "Kits" tab at right, under the "Auto-Detected" area, click on the Desktop Qt X.x.x clang ... entry. Below, under "Compiler:", for C, make sure "GCC (C, x86 64-bit, in /usr/bin)" is selected. For C++, make sure "Clang (C++, x86 64-bit, in /usr/bin)" is selected. Under "Debugger:", make sure "System LLDB at /usr/bin/lldb" is selected. Then press OK.

screenshot

If the C and C++ compiler are already selected but you're still seeing "No valid kits" errors, try clicking the default kit (under "Auto-detected") and then click "Clone" on the right hand side. Make sure the correct C/C++ compilers and debugger are selected, then click "OK". Now, you might be able to select the newly-cloned kit to configure your project.

If the issue persists after re-initializing and manually selecting kits as described above, try uninstalling and reinstalling Qt Creator as described previously. Make sure to check the MacOS checkbox during installation.

(Mac-only) Q: When I try to compile/run my project, the following error message. What does it mean, and how do I fix it?
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.

A: This is a bug with Qt Creator when used with Macs and Xcode 8. To fix it, first close Qt Creator. Then open a Terminal (use Spotlight and type terminal and press Enter), then copy/paste the following command into the terminal and press Enter. Then re-open Qt Creator and try again to run your project.

for FILE in `ls -1b ~/Qt*/*/clang_64/mkspecs/features/mac/default_pre.prf`; do sed -i.bu 's/xcrun -find xcrun/xcrun -find xcodebuild/g' $FILE; done
(Mac-only) Q: When I try to compile/run my project, the following error message. What does it mean, and how do I fix it?
Project ERROR: Could not resolve SDK Path for 'macosx'

Qt Creator works by layering on top of an existing compiler, and this means that it can't find a the compiler on your system. To fix this, go to the menu and select Xcode → Preferences → Locations → Command-Line Tools and select Xcode as your SDK.

(Mac-only) Q: When I try to run my program, I see red error text saying, "No Java runtime present, requesting install." But when I follow the prompts, it doesn't solve the Java issue and the box just pops up again later. How do I fix my Java on my Mac?

A: Don't follow those message prompts that pop up; unfortunately they lead you to the wrong version of Java. Go to this Oracle Java download page to download and install Java JDK on your Mac.

(Mac-only) Q: When I try to run my program in debug mode, I see a pop-up window with an error message saying, "No debugger set up." What does it mean? How do I fix it?
screenshot

A: This error sometimes shows up with newer versions of Xcode. Apple completely removed the "gdb" debugger from Xcode 5, so you have to use a new debugger called "LLDB" instead. Future versions of Qt Creator will detect this automatically, but Xcode 5 was released quite recently, so for now we have to fix this manually.

To fix the issue, click Qt Creator => Options => Build & Run => Kits. Click on the auto-detected kit => click clone => make default. Find the line which says debugger, and click edit. Change the selection from "GDB engine" to "LLDB engine", and type in "/usr/bin/lldb" in the text box.

screenshot

Once you finish doing that, you'll need to close Qt Creator. Go to the directory where you keep your assignment, and delete all files ending in ".pro.user". Then, click on the .pro file and you can reconfigure your project with the debugger ready to go.

You may also want to consult the following web page: Qt Creator - debugger engines

(Mac-only) Q: After upgrading my Xcode, when I try to compile/run my project, I get a message about a missing "wchar.h" file. What does it mean, and how do I fix it?

Follow the steps to "re-initialize" your project. If this does not fix it, we suggest uninstalling Qt Creator and re-installing it with version 5.9.2 or later. 5.9.1 and older may have incompatibilities with Xcode 9, but 5.9.2 and up should fix it.

(Mac-only) Q: When I try to run my project in the Debugger, the program just sits there. Why won't it run?

A: I don't know why this fixes it, but if you poke it a few times by putting breakpoints in your code as it's starting up, it'll work fine. (Number of pokes required varies.) Another thing that can work is clicking "Windows" -> "Views" -> "Debugger Log" and then entering any text you would like in the console to the left of the "Command: " prompt that now becomes visible in your Debug view. Number of pokes here is generally only one.

Q: I tried to add a new cpp file to my project. But now everything is broken. I am getting errors about duplicate symbols for every function I write in the new file.

A: Qt Creator gets confused when you add files to an existing project that has already been initialized. The best way to add a new file to a project is to close Qt Creator, put a blank new file into your project's src/ directory using your operating system's file explorer / finder. Then follow the steps to "re-initialize" your project. (The same holds true if you want to add an input file like a text file or image to your project's res/ or "Other Files" directory.)

Q: When I try to compile my project, I see this error: "Duplicate symbol for architecture x86_64"

A: It could be any of several reasons: Maybe you added a file to the project in Qt Creator, which adds a double-entry in your .pro file. Maybe you used "add a C++ class" feature in QtC, same thing. Maybe you forgot #ifndef around a .h file (if it's a later assignment about classes and objects). Whatever you did, the best thing to try is to follow the steps to "re-initialize" your project.

Q: When I try to compile my project, it says, "no reference to Main." What is wrong?
A: You need to put the following line at the top of your file:
#include "console.h"
Q: When I try to compile my project, I get an error similar to: "No rule to make target '../../../../../../../../../Qt/Qt5.5/5.5/mingw48_32/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri', needed by 'Makefile'. Stop." What is wrong?
A: Unfortunately, Qt Creator doesn't always play well with long folder paths or folder/file names with spaces in them. The easiest fix is to make a folder for class that's not in a super-deep folder, and make sure that the folder name (and the name of the folder it's in, and the name of the folder that one is in, etc) don't have spaces.
Q: When I try to compile my project, I get an error of: "invalid numeric argument '/Wextra". What is wrong?
A: This probably means that you are using the Microsoft Visual Studio C++ compiler rather than the MinGW GCC compiler that is required. You might need to uninstall Visual Studio from your computer or set up your Qt Creator not to use Visual Studio's compiler.
Q: When I try to compile my project, I get the very vague message, "Error 1". What is that, and what should I do?

A: This error can happen for a lot of reasons. Sometimes you renamed or deleted etc. a file in res/ that the compiler is looking for. Usually the best thing to try is to follow the steps to "re-initialize" your project. If that doesn't fix it, click the bottom "4 Compile Output" tab, copy/paste its entire output into either a Piazza post or an email to the instructor and TA (whichever your instructor has recommended for your class), and they may be able to help you.

Q: When I try to compile my project, I get the very vague message, "Error 2". What is that, and what should I do?

A: The most common cause of this error is when you put your project into a directory containing parentheses () in its name. Move your project to a directory that does not contain parentheses, follow the steps to "re-initialize" your project, and try again.

Q: When I try to compile my project, I get the very vague message, "copyResources Error 4". What is that, and what should I do?

A: This error can happen for a lot of reasons. Most often we have seen it when the student is running an international version of Windows (e.g. Chinese, Korean, etc.) and has folder or file names that contain international characters in them. Try moving your project into a simple folder name containing only English characters, and then to follow the steps to "re-initialize" your project. If that doesn't fix it, click the bottom "4 Compile Output" tab, copy/paste its entire output into either a Piazza post or an email to the instructor and TA (whichever your instructor has recommended for your class), and they may be able to help you.

If you have your project in a folder whose name contains international symbols, such as Chinese or Korean characters, please try moving your project to a different folder.

screenshot

(Windows-only) Another program that can cause this kind of error is Git. If you install Git on your system, it installs two programs that confuse Qt Creator. To fix this, either uninstall Git, or use your file explorer to go to the usr/bin subdirectory of your Git folder (default is C:\Program Files\Git\usr\bin) and rename the file bash.exe to bash2.exe, and sh.exe to sh2.exe.

Q: I have some other miscellaneous error or problem. Is there anything else I can try?

A: About 90% of random Qt Creator issues we've seen can be resolved by "re-initializing" your project. Follow the steps to "re-initialize" your project

"Help! It still doesn't work!"

If you tried to follow the above steps and were not successful, we will try our best to help you figure it out. If it's a laptop, you can bring it to office hours and show us the problem. Or you can contact us by Piazza or email (whichever your instructor has recommended for your class). If you email/Piazza post, please include the following information:

  • Your operating system (Windows 10, 8, 7, Mac OS X Yosemite, Fedora Linux 17, etc.)
  • Which step in the process has failed (be specific)
  • Any error messages you have seen (please include the exact text via copy/paste and/or a screenshot of the error you are seeing!)

Thanks, and good luck! You can do it!