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.

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 open my .cpp file, 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: 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 something like this: "No rule to make / could not find ..........\debug\FILENAME.o." What is going on?

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

(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.

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.

screenshot
(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. What is going on?
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.
(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 7 properly installed as described above. Follow the Java steps above to ensure that you do have Java.
(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 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 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.

(Mac-only) Q: When I try to compile my project, I see errors of "string file not found" and "No such sysroot directory." What's going on?

A: This error seems to happen when your system updates Xcode to version 7, which is not fully compatible with Qt Creator. Here are a few things you can try that may fix it.

1) Modify .pro file: Double-click your project's .pro file in the Qt Creator left panel. It will open in a text editor window. Scroll down to the following line:

QMAKE_MAC_SDK = macosx

Change that line to the following, then save and recompile.

QMAKE_MAC_SDK = macosx10.11

2) Downgrade to Xcode 6: Only try this if option (1) above didn't solve the problem.

  • Close Qt Creator. (You don't need to uninstall / reinstall Qt Creator.)
  • In your Finder application, go to the Applications folder. Find the item in that folder named "Xcode". Rename it to "Xcode7".
  • Now go to the Apple Xcode download page and download the most recent version of Xcode 6. (As of this writing, click the + next to "Xcode 6.4" and download the .dmg archive file.) You'll need to log in with your Apple ID account information.
  • Install Xcode 6 on your system by unpacking the .dmg file and dragging it to your Applications folder; it should put itself into the Applications folder and should call itself just "Xcode". You'll still have Xcode7 there, but now your machine should favor using Xcode (Xcode 6) instead.
  • Now launch Xcode 6 once so that it can download and set up its supporting libraries.
  • Now re-launch Qt Creator and try to recompile your project.
(Mac-only) Q: When I try to run my project in Debug mode, 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 (such as life-extra.cpp). 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 "re-initialize" your project as described below. (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 values for architecture x86_64"

A: It could be any of several reasons: Maybe you added a file to their 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 "re-initialize" your project as described below.

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 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 "re-initialize" your project as described below. If that doesn't fix it, click the bottom "4 Compile Output" tab, copy/paste its entire output into an email to the instructor and TA, and they may be able to help you.

Q: When I try to compile my project, I get the very vague message, "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 "re-initialize" your project as described below. If that doesn't fix it, click the bottom "4 Compile Output" tab, copy/paste its entire output into an email to the instructor and TA, and they may be able to help you.

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. 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.)

Steps to re-initialize a project:

  • 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.
  • 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_5_0_MinGW_32bit-Debug . Delete this entire directory.
  • Re-open your project's .pro file in Qt Creator. It should ask you to "Configure 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 email us. If you email, 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)

Thanks, and good luck! You can do it!