Qt Creator asks me to configure a compiler - qt

I'm running Debian 7, 32 bits. I've downloaded Qt here: http://qt-project.org/downloads
I took the link "Qt Online Installer for Linux 32-bit (22 MB) ". I then installed Qt, it worked but when I want to build a project, I get this error:
Qt Creator needs a compiler set up to build. Connfigure a compiler in the kit options.
I searched but I can't find how to solve this issue...

First make sure that you have a C++ compiler installed on your system and than in Qt Creator you go to Tools->Options->Build & Run->Kits and make sure that the kit has a compiler selected.

Related

How to fix: "line: 1; Qt Quick emulation layer crashed

The Problem
I cannot stress this enough but I have looked as far as I can over the internet for a solution and either they didn't have a solution or all they did was add a support ticket. The problem is that after creating a python qt quick application I try opening the QML file but when I go to the design tab it give me this error:
Code
The Designer is very finicky and can crash for various reasons. I've had success seeing the actual errors causing this dialog by launching Creator from the command line with debugging enabled:
QT_LOGGING_RULES="qtc.nodeinstances.init.debug=true" "/Applications/QtCommercial/Qt Creator.app/Contents/MacOS/Qt Creator"
That's specific to macOS but the like approach should work on any OS.
Look for error messages related to "Puppet". That's the name of the subprocess that actually renders the QML for Designer.
You can also go to Preferences -> Qt Quick -> QML Emulation Layer and try the opposite of the current setting and see if it works any better.
The solution that works for me is as follows:
OS: windows 10
Go to Tools >> Options >> Qt Quick >> (tab) Qt Designer
In the "Use fallback QML emulation layer", you see the placeholder path there. Switch it to C:\Qt\Tools\QtDesignStudio\bin or use browse if you have a different install location for Qt such that path\to\QtDesignStudio\bin
Boy do I have a FIX for you guys. I had been screwing around with this same issue to no avail, until I came across an error that wouldn't let me download qt3d (something) and I know that was part of the installation choices so I decided to uninstall everything. A thing to note when uninstalling: the Maintenance Tool doesn't uninstall everything. There were still Qt files located in C:\Users\user\AppData\Roaming I needed to delete those. Also, I needed to go into the Registry Run >>> Regedit >>>> Edit >>> Find >>> then search for Qt and that brought up all of the QT keys that still remained. I just deleted them one by one. For the Reinstall I practically installed everything (within reason) here's the list of my installation selections. Happy Hunting Fellow Qt'errr's!
Qt 5.15.2
Web Assembly
MSVC 2015-64BIT
MSVC2019-32BIT
MSVC2019-64BIT
MinGW 8.1.0 32BIT
MinGW 8.1.0 64BIT
UWP ARMv7 (MSVC 2015)
UWP x64 (MSVC 2015)
UWP ARMv7 (MSVC 2019)
UWP x64 (MSVC 2019)
UWP x86 (MSVC 2019)
Android
SOURCES
Developer and Designer Tools
Qt Creator 4.15.1 CDB Debugger Support
Debugging Tools for Windows
Qt Creator 4.15.1 Debug Symbols
Qt Creator 4.15.1 Plugin Development
Qt 3D Studio 2.8.0
-MinGW 8.1.0 32BIT
MinGW 8.1.0 64BIT
Qt 3D Studio OpenGL Runtime 2.8.0
MinGW 7.3.0 64Bit
Qt Installer Framework 4.1
Cmake 3.19.2 32bit
Cmake 3.19.2 64bit
Ninja
License: I chose L GPL
I chose Cmake not qmake
Graphic drivers were the issue in my case. Try updating or changing them.
Maybe that your Direct3D driver seems to have issues with Qt.
The error can be avoided by defining:QT_OPENGL=software in the Windows environment.
Assuming the root cause is the display driver of your computer.
Please reference:
https://bugreports.qt.io/browse/QTCREATORBUG-23455

How to use MinGW-64 with Qt Creator

I am aware that there are many post about this, but I honestly didn't understood any of it.
So, how do I install a kit for my Qt Creator (open source 5.7)?
I already downloaded and installed MSYS2.... don't know what to do with it.
I already downloaded and installed Qt64 - NG.... no clue what to do next.
I just want to be able to develop in Qt and chose betwen MinGW 32 and MinGW 64.
Thanks in advance!
EDIT: I also checked the wiki page. Most of the commands didn't worked. And I was told that it is outdated.
I know that your question is how do you install a kit for your Qt Creator, but first I think it's needed an introduction (Sorry for your eyes, English it's not my native language)
Introduction
The intention is to use the GCC compiler under Windows, what mean we need MinGW (Minimalist GNU for Windows).
MinGW only works for 32 bits, so we need the 64 bits forks, what means to use the MinGW-w64 or TDM-GCC flavors.
MinGW , GCC compiler for 32bits applications.
MinGW-w64 , GCC compiler for 32 and 64 bits applications.
TDM-GCC , GCC compiler for 32 and 64 bits applications.
With that we can create our applications/programs in Windows. In addition, we have other two different tools:
Qt Framework library, for create GUI's/Interfaces with multi-platform compatibility.
Qt Creator , an C/C++ editor, with additional editing tools for the Qt Framework.
About the binary compatibility chain
When we make an application, we've to follow the chain of libraries compiled with the same compiler version, the same way we've to follow the application binary interface (32 or 64 bits) for those libraries.
This means, if we want to compile an application for 32 and 64 bits with MinGW-w64 5.3, plus the Qt 5.7 Framework, we need:
MinGW-w64 5.3 (with flags 32 bits in the config) and the Qt 5.7 Framwork 32 bits build compiled under MinGW-w64 (MinGW-w64 version 5.3 or lower as long as they maintain binary code compatibility with our compiler).
MinGW-w64 5.3 (with flags 64 bits in the config) and the Qt 5.7 Framwork 64 bits build compiled under MinGW-w64 (MinGW-w64 version 5.3 or lower as long as they maintain binary code compatibility with our compiler).
Now come the weird thing. At Qt official webpage it's only available the 32bits builds for MinGW... I don't know why...
Here is when come the Qt64-NG project, a place where get the Qt Framework 64bits binary packages for MinGW-w64. Unfortunately the project is closed, so only are available until the Qt 5.5 Framework version.
I don't know other place where to get newer 64bits Qt binary packages for MinGW-w64 (Maybe the ones at MSYS2 project? I didn't tried yet). So, if one need it, at this moment must be compiled by oneself (This is for answer your opensource 5.7 comment).
Install and configuration
Now your question. How to install a kit for your Qt Creator. I'm going to answer for 64bit binaries because it's what I use (and latter you just need to do the same thing for 32bits)
For use Qt Creator with MinGW-w64, one just need:
Download Qt Creator and install it. My advice is to download the 4.1 (or upper version) snapshots if one is going to use CMake projects.
Download MinGW-w64 (posix-seh , or your choice flavor) + decompress in one folder.
That's all, with this we can create 32 and 64 bits applications.
By other way, in addition to the above steps, if one want to create applications using the Qt Framework library (a GUI/Interface for our applications), it's needed the binary package, this case 64 bit (The 32bit binary package is available at the Qt official page)
Download Qt64-NG (posix-seh , or your above choose flavor) + decompress in one folder.After that it's needed to execute the qtbinpatcher.exe included in that directory, just a double click.Note: If you change this directory to other path, execute again qtbinpatcher.
Here is where end the installation process. In my case, I have all under the same folder. Example:
D:\Programacion\mingw64_5.3.0rev0\
D:\Programacion\qt64-ng\qt-5.5.0-x64-mingw510r0-seh\
Now you just need to configure QtCreator, in this case:
Tools > Options > C++ , Compilers, Add > MinGW
In name put the compiler version, MinGW-5.3 x64 It's the name that will be shown in Kits
In Compiler path browse for the C++ compiler path, in this case D:\Programacion\mingw64_5.3.0rev0\bin\g++.exeTake note in ABI it's selected to use 64 bits flags in the compiler. That's why we put in name x64. For 32 bits, just duplicate and change the selection.
Tools > Options > C++ , Debuggers, Add
In Path browse to the debugger path, in this case D:\Programacion\mingw64_5.3.0rev0\bin\gdb.exe
In name put the name showed at version, GDB 7.10.1 in this case.It's the name that will be shown in Kits
And, if one want to create 64bits programs using Qt Framework, in addition to the above:
Tools > Options > C++ , Qt versions, Add, and select the qmake.exe placed at the qt64-ng bin directory.
In this case is, D:\Programacion\qt64-ng\qt-5.5.0-x64-mingw510r0-seh\bin\qmake.exe
In name put Qt %{Qt:Version} (qt-5.5.0-x64-mingw510r0-seh)It's the name that will be shown in Kits tab
Now you just need to specify the Kit:
Tools > Options > C++ , Kits, Add
In name MinGW-5.3 x64 (Qt-5.5)
In compiler select MinGW-5.3 x64
In debugger select GDB 7.10.1
In Qt Version select Qt 5.5.0 (qt-5.5.0-x64-mingw510r0-seh)
And in CMake goes the CMake path if one is going to use it (I use it with Ninja ).
Note: For install Ninja just copy ninja.exe to the mingw-w64\bin directory, and at the Kit, in Cmake generator push change to generator->ninja , and Extra generator->CodeBlocks. Ninja launch several make commands at same time, what decreases compilation times.
Long text for 1 minute of configuration. The Kit is what we select for compile the project, and one can have as many Kits as one wish (CompilerA x32 + Qt5.x , CompilerB x64 + Qt5.x , CompilerX x64 + Qt4.8, etc, etc).
Now, before to finish, an important thing. After we create a project (and the project it's open), at the Projects selector (Ctrl+5) we've to take care of the Build Environment variables.
Those are the variables that are going to be added at the command who launch our Runs/Builds for testing and debug.
In PATH it's needed to put the paths to MinGW-w64 and to Qt64-NG. And under my humble opinion, I recommend to put it in that order because of dll's. Following our example:
PATH D:\Programacion\mingw64_5.3.0rev0\bin;D:\Programacion\qt64-ng\qt-5.5.0-x64-mingw510r0-seh\bin;the_other_paths
At QtCreator snapshots branch I don't need to check it, it's done automatically
Most of the C/C++ editors works that way. To install editor, specify compiler&debugger path, and specify Build Environment variables for launch from the editor (overriding those environment variable that we've in Windows).
Note: I recommend to compile Qt Creator with 64 bits, due as happen with the Framework, for Windows it's only available in 32 bit at the official Qt website
Alternative way
By other side, we have:
MSYS2 , a Linux like tools environment.
There is all the same, just we download/install the packages with the pacman command, and are available the 32 and 64 bit versions. Those applications need to be launched from MSYS2 shell. It's not a binary compatibility thing but a paths matter.
The libraries available at MSYS2 project can be used in the first tool chain I described (due are build under MinGW-w64 also).
EDIT: Corrected namings, the last explanation, and added Ninja's url and installation note.
You should decide if you are going to use the MSYS2 ecosystem or not. If you want to use MSYS2, you should uninstall the Qt software that you downloaded separately to avoid confusion. For the rest of this answer, I'll assume you are using MSYS2.
You can install these MSYS2 packages using pacman:
mingw-w64-i686-qt
mingw-w64-i686-qt-creator
mingw-w64-x86_64-qt
mingw-w64-x86_64-qt-creator
Then open up a MinGW-w64 32-bit or 64-bit shell using the appropriate shortcut in your Start Menu, and run "qtcreator" at the command line.
You can also use other build systems to build your software. I have used CMake successfully for building Qt applications in MSYS2, instead of Qt Creator.
Directly launching from explorer will also work, unless you need to use qtcreator's Autotools plugin in which case launching it from an msys2 shell is necessary (so that various environment variables are set correctly).

Installing and compiling using the Qt Creator

So I thought upgrading Qt and Qt Creator was a good idea since I used an older version of both.
I re-installed everything as I should and realized that Qt 5 is only for VS2010 for Windows which I have never worked with since I have been sticking with minGW up to this point,
I then realized my problems that my project wouldn't compile and run so I tried to download the 4.8.4 version with minGW, but that complained that:
"The installer could not find a valid c:\MinGW32\include\w32api.h
(Only versions with W32API3.13 are supported)"
and further I did not get creator when I installed it either.
Any help that would either let me go back to 4.8.8 minGW or a simple straight forward way using Qt creator with VS2010 would be appreciated, thanks.
I think I solved parts of my own issue (at least enough to answer this problem).
1: Download and install latest minGW installer and add ';C:\MinGW\bin' to the system variable 'path'.
2: Download the Qt 4.8.4 and install it (Does not come with Qt Creator) and add'C:\Qt\4.8.4\bin' to the system variable 'path'.
3: Download the latest Qt Creator, launch it and go:
tools -> options -> build & run
From there choose the correct Qt version by pointing to the Qmake in the Bin folder (C:\Qt\4.8.4\bin in this case)
Also make sure it auto detects minGW compiler, if it does not show up I am not sure what to do.
4: If you are including a project from other Qt versions you might have to delete the users.pro file (not the .pro file) to get it to compile properly.
Last issue is that I do not have any debugger, but the program compiles in the /release folder (if you put CONFIG += release in the pro file) and I can run it by using the .exe.
Using MSVS 2010 as the compiler isn't too hard.
Download Visual Studio Express 2010.
Install it, and now you have MSVS 2010 compiler available.
The compiler should be located under C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin or somewhere similar at cl.exe.
Setting up the latest version of Qt built against MSVC 2010, with the latest Qt Creator isn't too bad, either. In Tools > Options > Build and Run > Kits, find your Qt qmake installation, and in Tools > Options > Build and Run > Compiler, find your compiler.
Now you can use the amazing Qt 5 instead of sticking in the past with 4.8 (even though Qt 4.8 is awesome and works really well, too).
Hope that helps.

Qt Creator 4.8.4. windows 7 - 64bit installation

I have some difficulties with QT, which I need for school for some GUI applications.
I have recently done these steps:
1) mingw-get-inst-20120426.exefrom SourceForge installed to C:\MinGW\ with default settings.
2) Qt libraries 4.8.4 for Windows (minGW 4.4, 317 MB) from QT Project installed to C:\Qt\ with default settings. Here an error occurs:
!!!There is a problem with your MinQW instalation
!!!g++ not found in c:\MinGW\bin\
!!!Do you still want to continue? Yes
I checked c:\MinGW\bin\ there is no such file
3) Qt Creator 2.6.0 for Windows (51 MB)also from QT installed to C:\Qt\gtcreator-2.6.0 with default settings
4) Run the QT IDE
5) Open project or create new project. Another error occurs here
!!!No valid kits fond.
Qt Creator uses the invalid kit Desktop to parse the project.
6) Open Options->Build & Run->Kits (But I don't know how should I set Kits and where to find them).
7) Can you also help me, how to set Qt version
(Options->Buid&Run->Qt Version)? Where do I find qmake.exe?
I also didn't find how to create GUI Application. There is no such option in New File or Project...
Thanks for help.
That is quite tricky ;)
Precompiled Qt (MinGW) is only win32 (not win64).
Precompiled Qt is compiled with MinGW-g++ 4.4 and won't work with other.
You have to download this one:
http://get.qt.nokia.com/misc/MinGW-gcc440_1.zip
//// Edit: With this version of MinGW, gdb won't work (it's not python-enabled). Although QtSDK is depracted (and you won't find it on qt-project.org), I highly recommend downloading this online installer and, during the selection of components mark only MinGW. It will come with folder named "pythongdb".
http://www.developer.nokia.com/info/sw.nokia.com/id/da8df288-e615-443d-be5c-00c8a72435f8/Qt_SDK.html
(You may need to register. It's free.)
////
Add "Compiler" by g++.exe
Add "Qt Version" by qmake.exe.
Add "Kit" with Compiler and Qt Version configured above. You can try to change debugger from CDB to GDB.
When you installed mingw, did you select the C++ compiler? It is not selected by default but you need it. Re-run the wizard and select that.
The kit is not valid because the C++ compiler cannot be found: try to install it first. If you still cannot setup this read the manual: http://doc-snapshot.qt-project.org/qtcreator-2.6/creator-targets.html. It is very complete.
qmake.exe is in *qt_directory*/bin/qmake.exe.
Try this out:
http://sourceforge.net/projects/mingw-w64/ (Since the mingw-w64 project on sourceforge.net is moving to mingw-w64.org i suggest to use mingw-w64.org)
It works for me.

Qt 4.8.3 installation on Windows 7 & QtWebkit problems

I just updated my Qt to 4.8.3, because the program built from older version is not compatible to the new framework.
So I have to upgrade.
This process was frustrating and time consuming. So many problems came out.
I download Qt from this url:
http://qt-project.org/downloads
At beginning, I installed the MinGW one (I'm not a fan of MSVC).
I tried the newest ( I think it's 4.6) version of MinGW and order version (4.4).
However, after I installed MinGW and tried to install Qt 4.8.3, during the process, the following message shows up:
There is a problem with your MinGW installation:
The installer could not find a valid C:\MinGW\include\w32api.h (Only versions with W32API 3.13 are supported)
Do you still want to continue? (Your installation may not work)
The 4.6 version does have this w32api.h file, I don't know what's going on. And I have trouble finding MinGW 4.4 with this head file.
I decide to ignore this warning and continue to install Qt and Qt creator. After that,
I opened my current project, configure it (why the configuration become so complex...), I tried to build it.
Then the following message shows up because some external lib I used requires Exception Handling:
exception handling disabled, use -fexceptions to enable
And I don't know how to enable the it.
I tried to add -fexceptions flag in QMAKE_CXXFLAGS but it doesn't work.
By the way, I tried the VC version of Qt too, but I used the MinGW before and the VC compiler is quite different, if I use VC version, it will take a lot of time to make it compilable by VC compiler.
Does anyone know how to install Qt 4.8.3 on Windows? my project works fine before, now I just want to compile it successfully.......
These are not the only problem.
I updated the Qt on Mac machine too, it is easier to have the compiler work since it's unix base.
However, I used QtWebkit lib in my project and obviously, they changed this lib and it's not compatible to order version.
I can compile my project on Mac, however, every time I run it, following massage shows up and the program stopped.
dyld: Symbol not found: _OBJC_CLASS_$_CALayerHost Referenced from:
/Library/Frameworks/QtWebKit.framework/Versions/4/QtWebKit Expected
in:
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
The program has unexpectedly finished.
Does any one know how to solve this QtWebKit problem? I'll really appreciate.
I remembered that when Qt is under nokia, it's so easy to install and use, the Qt SDK is perfect.
I really hate the change made after it was bought by digia.........
I found solutions of my first two problems:
for the first problem, as I described, download the MinGW provided by Nokia Qt
ftp.qt.nokia.com/misc/MinGW-gcc440_1.zip [ftp.qt.nokia.com]
Tried several versions of MinGW 4.4, I think this is the only one works.
About the second problem, add following configure in the project file:
CONFIG += exceptions
Now the QWebKit problem is only one unsolved.
Is it all relevant that your include directory for MinGW has two "i's" in it or was that a typographic error when posted on SO? See:
The installer could not find a valid C:\MinGW\iinclude\w32api.h

Resources