Error including serialport in project.pro file in QT - qt

I have downloaded the latest version of QT and I am including the serialport in .pro file but it says
Project MESSAGE: Warning: unknown QT: serialport
And because of this, I am not able to include the QSerialPort in my project. I don't know why its not available as I am using the latest version of QT. Here is the screenshot of the QT about menu:
Can anyone please suggest me something. Thanks.!

Related

Have a 32-64bit problem with OpenCV and Qt

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?

Project ERROR: Unknown module(s) in QT: websockets

I'm trying to run a simple client example using QTWebsockets using Qt Creator, already add the
QT += websockets
But it throws this when i run build or qmake
:-1: error: Unknown module(s) in QT: websockets
I tried
QT += core websockets
Then realized that since installed Qt Creator from the repositories it wasn't up to date, so I reinstalled it from the Qt website but the problem persisted, I then ran pkg-config --modversion QtCore and it returns 4.8.6, thing is, in the QT version tab of qt creator it shows 5.4.1 to GCC compiler which is the compiler I’m using, in /opt/Qt/5.4/gcc_64/lib there is the QT5WebSockets module even in the help tab are listed the QT5 modules but I can't use them.
Tried with SerialPort and it didn't work, tried with Opengl and it worked which means is a version problem but I can't seem to find how to solve.
sudo apt-get install libqt5websockets5-dev
I solved it, the problem was that I just opened the project I made with qt4, when I tried to build it in the freshly installed qt creator the .pro.user file kept pointing to all qt4.
Solution, create a new project and add the source from the first, or change all the references from qt4 to qt5.
sudo zypper install libqt5-qtwebsockets-devel

cannot open input file Aggregation.lib while build Doxygen source with Qt

I'm using:
Qt 4.8.4
Qt Creator 2.7.0
Qt Creator source 2.7.0
Doxygen source Revision 57
Building Doxygen (Doxygen plugin for Qt) source [svn.kofee.org] with Qt 4.8.4 for Desktop – MSVC2010 and QtCreator 2.7.0 output the following:
-1: error: LNK1181: cannot open input file 'Aggregation.lib'
The plugin needs to be built against a fully compiled in situ qtcreator on Windows, unnecessary files are stripped from the distribution package but the compiler needs them to link the object codes together. You should ask on the website for a slightly quicker answer :)

Qt Creator 2.6.2 and Qt 4.8.4: Qt version is not properly installed

Windows 7: I have installed Qt 4.8.4 Win and Qt Creator 2.6.2 Win, VS2010 (from here). When I try to open a project (previously compiled with Qt 4.8.3 / Creator 2.5.2), it says I need a kit (no valid kit) and eventually I end up at Qt version is not properly installed. All is shown in the screenshots below.
I have checked some solutions:
SO QT version is not properly installed, please run make install is for Linux
Some say, I need to install Qt SDK, but where do I find this (this one contains older Creator / Qt versions), and what sense would the individual installers make if I need SDK?
Some say, I need to add Qt to path, but what exactly? Creator? The Qt 4.8.4, the qmake dir?
Somehow I fail with this make install, nothing happens.
I have installed the 5.0.1 including Creator 2.6.2 as one installation, this works. But when I then download 4.8.4. and try to add it as QT Version, same issue: Qt version is not properly installed
Any idea what I would need to do or install.
-- Edit -- List of trials ---
Added my Qt 4.8.4 and its qmake dir to PATH
Re-installed Qt in different order: Qt 4.8.4 first / Creator 2.6.2 thereafter
Opened Qt CMD Prompt qmake install (as in the suggestions): 4.8.4\install:1: Parse Error ('INSTALLING Qt Source Package Version 4.8.4.') Error processing project file: install
qmake install from Qt CMD. Runs 20 minutes, Laptop gets extremly hot, then it crashes
P:\Qt\Libs\4.8.4>qmake\qmake.exe install
QMAKESPEC has not been set, so configuration cannot be deduced.
Error processing project file: install
I had the same problem. Try to choose "qmake.exe" from the BIN folder, not the qmake folder, so in your case probably P:\Qt\Libs\4.8.4\bin\qmake.exe
Based on SO: How to install Qt on Windows after building? I eventually got to http://qt-project.org/doc/qt-4.8/install-win.html
Simply running configure solved it for me, I did not build, nothing else. The installer did apply several patches, so I still do not get why I have to run configure.

To avoid Qt Creator from source mistakes the version of Qt upon building

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.

Resources