I use MSYS2 on Windows 10 and have installed Qt 6.2.0 and Qt Creator 5.0.2.
Then I set up Qt Kit and see this warning:
Qt Kits warning
Warning: The compiler "MinGW-w64 MINGW64 C++ (MSYS2)" (x86-windows-msys-pe-64bit)
may not produce code compatible with the Qt version "Qt 6.2.0 (mingw64)"
(x86-windows-msys-pe-64bit).
How to address this issue?
I use MINGW64 subsystem of MSYS2 that has following related packages installed:
mingw-w64-x86_64-gcc 11.2.0-1
mingw-w64-x86_64-gdb 11.1-1
mingw-w64-x86_64-qt-creator 5.0.2-2
mingw-w64-x86_64-qt6-* 6.2.0-2
I failed to figure out toolchain version that was used to build Qt6 packages in order to provide the same toolchain for building applications. The only information I got is ABI : x86-windows-msys-pe-64bit and QT_VERSION : 6.2.0.
Warning message says both compiler and Qt have similar x86-windows-msys-pe-64bit ABI, but it seems to be insufficient.
Until this point I successfully build, run and debug code, but still would like to get rid of this warning if it makes sense.
It turns out this warning goes away when GCC compiler in Qt Creator Kit settings and GCC compiler used to build Qt installation have exactly the same versions.
Using mingw64/share/qt6/mkspecs/qconfig.pri, as suggested by ssbssa, I've got GCC version Qt installation was built with and supplied Qt Creator Kit with GCC compiler that have the same version. Now I see the warning is gone.
Related
I have used OpenCV 3.2.0 since a long time ago.
Recently, I need to implement face detection with landmark detection so I decided to build the OpenCV again with extra OpenCV modules.
However, it seems that OpenCV 3.2.0 is not compatible with the latest extra OpenCV modules so I have to build it with the latest OpenCV (which is 4.0.0)
The problem is, I'm in a Catch 22 situation.
1. If I use mingw 32bit 5.1.0 to build OpenCV (which is a compiler bundled with Qt), I have a following error
CMakeFiles\opencv_core.dir/objects.a: member
CMakeFiles\opencv_core.dir/objects.a(vs_version.rc.obj) in archive is
not an object
2. If I use mingw 64bit 8.1.0 to build OpenCV, it works fine. However there are two situations that give me an error.
2.1. If I use mingw 32bit 5.1.0 to build a Qt Project with those OpenCV libs, it gives a following error.
D:\opencv-build\bin\libopencv_core400.dll:-1: error: file not
recognized: File format not recognized
I suspect that this has something to do with 32-64bit problem. The compiler may expect 32bit libs, but the libs are 64bit format because the compiler used to build OpenCV was 64bit mingw.
file format pei-i386
file format pei-x86-64
The first one is the file format of the OpenCV 3.2.0 libs which I used in the past and worked fine with Qt.
The second one is the file format of the OpenCV 4.0.0 libs newly built.
2.2 If I use mingw 64bit 8.1.0 to build a Qt Project with those OpenCV libs, it gives a following error.
collect2.exe: error: ld returned 5 exit status
I suspect that this occurred because basically Qt is for 32-bit, not 64-bit.
What I want to do is that building OpenCV 4.0.0 so that somehow the file format of those OpenCV libs is pei-i386, not pei-x86-64.
How can I achieve this?
I have a C++ project using cmake and Visual-C++ compiler.
Though I'd like to make a fake compilation with gcc just to get the warnings of the gcc compiler. This will fail to link because it has to link with external Visual-C++ binary dependencies, but I just need the compilation errors/warnings, not the link part.
Is there a way in Qt Creator to run such a fake build on the fly without changing my CMakeCache ?
I am trying to get qt webengine running on my laptop for the first time, but can't seem to build it. I am following the instructions from here:
https://wiki.qt.io/QtWebEngineHowToTry
On the last few steps, I had to run "qmake -r" on the qtwebengine directory. This is the output:
SSL............................... Using system NSS
ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG += use_system_icu)
FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg)
Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG += use_proprietary_codecs)
Reading /home/kevin/workspace/qtwebengine/src/src.pro
Reading /home/kevin/workspace/qtwebengine/src/core/core.pro
Reading /home/kevin/workspace/qtwebengine/src/core/core_gyp_generator.pro
Project ERROR: Unknown module(s) in QT: webchannel
This error happened right after I installed WebKitGtk+ from here (http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" and "Tools/Scripts/update-webkitgtk-libs". Before I installed WebKitGtk+, qmake would terminate at a later point.
(I installed WebKitGtk+ because, previously, running "qmake -r" on the qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that I tried to fix on my own via google, and the WebKitGtk+ page was the only lead I could find that would supposedly fix that issue... big mistake!).
I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. I installed qt5 via apt-get install, but apparently I have both qt4 and qt5 plugins installed, as well as qtchooser (I'm guessing from the WebKitGtk+ installation scripts).
Here is the output of "qmake --version":
QMake version 3.0
Using Qt version 5.4.1 in /usr/lib/x86_64-linux-gnu
Any help would be greatly appreciated, as I'm excited to try out qt webengine!
In case anyone else has the same problem, I fixed it by installing qt 5.5.0 from here http://download.qt.io/official_releases/qt/, and using the associated qmake binary from that installation. I guess installing qt from 'sudo apt-get install' still has some issues that won't work with qtwebengine.
I just installed Qt 5.2 package on ubuntu. I simply created a Qt widget application, and when I tried to build it, I got the following message:
Qt Creator needs a compiler set up to build. Configure a compiler in
kit options
I have tried several things, all of which were unsuccessful. I tried setting the compiler kit to
Desktop Qt 5.2.0 GCC 32bit (default)
However it didn't work
After that I set the compiler to
GCC (x86 32bit in use/bin)
However that didn't work either.
I also tried adding gcc manually and gave it the path
/usr/bin/g++-4.6
but it still didn't work.
This is what appears in there Qt Version tab
This is what I get when I remove the .pro.user file and restart the IDE, Whats the difference between configuring a project as Desktop and Desktop Qt 5.2.0 GCC 32bit?
Qt Creator needs a version of tools that are able to link against the Qt binaries that the downloaded package contains. In your case, the local toolchain and the binaries don't match. That means that you would actually have to build the Qt with your toolkit and make sure that QtCreator can find the built binaries.
The simpler way for Ubuntu is to use the packaged version of the tools; they play well with the already delivered binaries. Use sudo apt-get install qtcreator to install it with all the dependencies.
I got the following error when I try building Qt Creator from source.
user#host:/usr/share/qtcreator/qtcreator_build$ qmake -version
QMake version 2.01a
Using Qt version 4.8.2 in /usr/local/Trolltech/Qt-4.8.2/lib
user#host:/usr/share/qtcreator/qtcreator_build$ sudo qmake ../qtcreator_fromSrc/qtcreator.pro
Project MESSAGE: Cannot build Qt Creator with Qt version 4.6.2.
Project ERROR: Use at least Qt 4.7.4.
As shown, the Qt library in use above is 4.8.2, which should be qualifying ver 4.7.2. It's installed from source. How can I let the qtcreator installer recognize the right qt version?
My workaround was to copy the source of Qt Creator to the area that doesn't require super user permission. HTH.