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:
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.)
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:
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.
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.
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.
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.
(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?
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.
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.
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.
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:
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.
*** *** 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: 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.
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.
A: The 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.)
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 delete the folder Qt5.10.0 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.
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
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.
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.
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.
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.
If you see this, and the "re-initialize project" steps above do 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.
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.
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.
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.)
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.
#include "console.h"
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 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.
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 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.
(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
.
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:
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:
Thanks, and good luck! You can do it!