Can not set android clang compilers for Qt Android on Ubuntu - c++

I installed Qt Android 5.15.2 on Ubuntu but there is problem with the compilers. This is what I have set:
And here is what QtCreator detects as compilers:
The first error is displayed here in the Qt version tab:
and also in the Kit tab I see this errors no matter which compilers I set from the available:
Why I got this errors? Can please someone that has android kit on Ubuntu already set, tell me which compilers is using and which paths are for the compilers?
I will add more information for the current compilers or kits if needed.

The problem is that you are trying to use a x86 compiler for Android. You need to install the specific compiler from the Android SDK/NDK. So the good news is that you might be only missing one step (step 2 below)
I tried to install from the Ubuntu stock packages. That was impossible to get to work.
I was able to set it up in the following way:
Download the Qt online installer. Login and DO NOT choose individual packages, install Qt for desktop and Qt for mobile (check the last 3 options). This will install Qt 6 + QtCreator
Run QtCreator after everything finishes (+1.2Gb download). Go to Tools>Options>Devices>Android. Check that Java SDK is ok. On the Android section, choose "Set up Android". Accept all licenses.
This is what you should see in the end:

Related

How to make Qt Creator use Rosetta and x86 compiler on Mac M1?

I am using Qt 5.15.2 on my Mac mini with M1 chip. This works fine (due to Rosetta). Below is the list of compilers Qt Creator found on this computer, and among them is the C++, x86 64bit that I use. No problem.
I would like to use the same settings on a (somewhat newer) Mac Book Pro (also with M1 chip). Below is the list of compilers Qt Creator finds on this computer, the x86 is now missing!
I do not know if I have a x86 compiler on the new M1-computer. I have installed Xcode and the command line tools for XCode 13.2.
Can I somewhere tell Qt Creator that the deployment target is x86?
Does /usr/bin/clang++ only compile for the ARM/M1-chip, or can it also produce and link to x86 code?
if not, how can I find out if there is an x86 compiler on my new M1-computer?
If the compiler is missing, how to install it?
Any help would be most appreciated!
A few tips that can help, I just setup a project using Qt 5.15.2 on a 2021 M1 Mac.
Note this will likely be different for Qt >= 6.
Can I somewhere tell Qt Creator that the deployment target is x86?
Yes, you can do this using specific argument in the build settings of your kit.
Add the QMAKE_APPLE_DEVICE_ARCHS="x86_64" additional argument to qmake.
Also, add an additional CMake option: -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64"
ℹ️ Click Manage Kits.. in the projects view to open the preferences editor where you can update your CMake configuration.
Does /usr/bin/clang++ only compile for the ARM/M1-chip, or can it also produce and link to x86 code?
With rosetta installed (/usr/sbin/softwareupdate –install-rosetta –agree-to-license), and the configuration above, yes you can compile and link x86 binaries.

Do I need to install Mingw compiler components in Qt installation if i had already installed Mingw in my computer?

I installing Qt open source framework in my window 10 pc. I already downloaded Mingw compiler and installed it to write C/C++. Now I wanna learn QT framework. I using Qt online installer. I choice to download custom compoment. Do I need to selet mingw component to download if i had already installed?
Note that there's not just one MinGW distribution and version out there. You can check out the exact supported version per Qt release at https://wiki.qt.io/MinGW .
Anyhow, if you install the pre-built Qt binaries via the online installer, the matching MinGW version will automatically be installed for you, and will be registered in Qt Creator so that things just work. There is actually no official way to prevent this.

QT enable cross-compiling using MinGW (precompiled)

Good day all
I have been searching for a method of cross-compiling for QT-Creator in Linux for sometime now, and I have been having alot of trouble with it.
Background info
please note: I am on a Linux machine, and would like to cross compile Windows Apps
My system:
Ubuntu Gnome 16.10
QT Creator 4.0.2 (based on QT 5.7)
I have came across a few SO links, a few blogs with broken instructions, etc and one seeming helpful but dependencies could not be found.
I have also attempted another compiler MXE and cloned and attempted to build the MXE compiler from the GIT repo, which failed (no solution for the build error - VTK build error)
I decided to download precompiled MinGW compilers (i686 and x86_x64 versions) from sourceforge
Issue:
In QT Creator, adding the compiler is done without an issue, adding the "Kit" and selecting the newly added compiler, an red exclamation gives an error
The Compiler (x86_windows_msys_pe_64bit) cannot produce code for QT version 5.7.0 GCC 64Bit (x86_linux_generic_elf_64bit)
This occurs for both 32 + 64 bit compilers.
I think that you should have a QT version that matches your compiler ABI. The error tells you that the MinGW compiler doesn't match the Linux version of QT you have used. Therefore, get a windows version of QT and use it instead (just as you've added WinGW).
You can download Qt Binaries from here.

Can't create console application project in QT creator - No valid kits found

I already add a kit in Tool->Options->Kits->ADD
and when im trying to create a console application it says "No valid kits found"
Click the Option hyperlink (or Tools --> Options) in the Kits tab, select the Desktop (default) entry below the Manual. You will see that the Qt version is blank, click the input control and select the right qt version and Apply or OK.
QtCreator did not find and tool chains.
Use the Qt Online Installer for Windows to install MinGW or MSVC tool chains.
If your qt sdk is x64 you need to install x64 mingw compiler. If not than install i686 mingw for compiler. Here is good guideline which you can learn how to install qt creator, qt sdk, and mingw for w8.1 machines.

qmake on a mac missing for qt-creator

I am working on Mac OS X at the moment, and wanted to start building apps using Qt Creator.
Unfortunately i can't build any applications as it gives me an error saying that qmake's path is not found or qmake is missing.
I tried using netbeans, which works perfectly with simple c/c++ programs, but for qt apps it then gives me the same error.
My version of Xcode 4 works perfectly and builds without any problems.
Any ideas?
Thanks :)
It is not enough to just download the Qt Creator, you need to download the complete sdk: http://qt.nokia.com/downloads (almost 1GiB)
My Macbook is no longer my primary computer. But, when it was, I found out through painful experiences that it was best to install software from MacPorts whenever what you wanted was available from http://www.macports.org/
Even more important, I also discovered that when software was not offered from MacPorts, it was invariably because that particular software did not install without some sort of tweaking on a Mac. Hence, since Macports does not currently offer Qt v5, and I had problems installing the qt-project.com Qt v5.2.1 SDK on my Macbook, I would advise to go with the MacPort for Qt v4.8.5 [qt4-mac] which includes qmake. Qt Creator is available as a separate MacPort [qt4-creator-mac].
Here is how I successfully installed Qt v4.8.5 [with qmake] and Qt Creator on my Macbook:
1) 'sudo port install qt4-mac'
2) 'sudo port install qt4-creator-mac'
3) I used Finder to run Qt Creator which was in the /Applications/MacPorts/Qt4 folder.
4) When I first ran Qt Creator, its Preferences dialog listed the auto-installed Desktop kit, but that kit had no Qt version, no qmake, and no debugger.
5) Manually added a second kit.
6) Configured kit's Qt version for /opt/local/bin/qmake, which is where qt4-mac installed qmake. This was enough for the kit to now discover Qt v4.8.5 which had been installed by qt4-mac.
7) Used kit's auto-detect feature to now discover the debugger.
8) Configured that kit to be the default kit.