Unknown module(s) in QT: declarative - qt

Sorry, this may be a dumb question, but I'm totally new in QT, I just need to run a project and Log some data.
I installed Qt "qt-unified-windows-x86-2.0.3-2-online", open the project and then click on configure, and then I got this error:
Unknown module(s) in QT: declarative
which wont let me compile the code. Everything else looks fine.
From researching I get that I may lack some libraries, I'm using windows, How do I get the proper library in windows? which is the library I need?
I'm using "Qt Creator user the kit Desktop Qt 5.7.0 MinGW 32bit."
Thank you.
I'm downloading linux, a live version, to try to run the code in there

The error occurs when trying to build a project that depends on the deprecated QtDeclarative module on Qt version 5.6 and later, as the module was removed in version 5.6.
The source code for the module is still available you can compile it from source. Or you can install a Qt version below Qt 5.6 to build the project.

You probably don't have declarative library installed somehow, here it is recommended to use a command-line utility named windeployqt, something like
windeployqt -declarative

Related

Run Binary With Specific QT Version - Cannot mix incompatible Qt library

I'm trying to replicate an application that we currently have running on a physical Ubuntu server using an Ubuntu machine in Virtual Box. It is a QT application but on the server we are running it using pm2 from NPM. After installing QT, and installing drivers needed for the application i've tried to run it but keep coming across this error:
Cannot mix incompatible Qt library (version 0x50701) with this library (version 0x50905)
I've inherited the code from someone else and don't want to change the project to QT5.9.5, so i'm trying to run with 5.7.1, I've followed instructions on other questions in order to change the QT version to 5.7.1 but still get the same error when running it.
I followed the instructions here:
https://unix.stackexchange.com/questions/116254/how-do-i-change-which-version-of-qt-is-used-for-qmake
When checking the QT version using "qmake -v" in the console I get the following output:
QMake version 3.0 Using Qt version 5.7.1 in /home/sam/Qt5.7.1/5.7/gcc_64/lib
So although it looks to me like i'm using the desired version of Qt (5.7.1), i'm still getting the incompatible library issue, i'm very new to all of this so apologies if this is a stupid question. If anyone could tell me what to do in order to use the compatible library that'd be great, thanks.
I will try to explain this in steps!
Each complete set of Qt libraries is called a Qt "distribution". You can get Qt distributions from a variety of sources:
Installed from the package manager of your OS (.deb/.rpm).
From a downloaded zip file on http://qt.io
As a cloned repo from git
etc..
Some of the available Qt distributions will come pre-built, and some will need to be built from sources. In either case they will all have a qmake program that is specific to that particular Qt distribution. This program is responsible for building programs so that they link to the particular Qt distribution that the qmake is part of. qmake is also used when building with QtCreator.
If you have a binary built with one qmake and you try to run it on another computer, it might find the wrong Qt libraries during dynamic linking and spit out errors of "incompatible version of Qt".
There are many solutions to this problem;
Collect all the Qt libraries (Mine are in /home/myusername/Qt/5.version/gcc_64/lib/*.so) in the same folder as your program executable. This will make sure they are prefered to any other version of Qt that may be in your dynamic linker's path.
Uninstall the OS supplied Qt version(s). This may not be advisable especially if other programs use them.
Rebuilt your program from source using the correct qmake.

Cross-compiling QtDeclarative for raspberry pi

I'm trying to cross compile qml for Raspberry pi 3 on a x64 Ubuntu.
I followed this tutorial
https://wiki.qt.io/RaspberryPi2EGLFS, installed Qt 5.6.3 and managed to run QtWidgets applications pretty easily and I'm now looking to use QML.
From what I understood, I need to install qtjsbackend and qtdeclarative for it to work so I cloned the github repositories and installed qtjsbackend without any trouble.
now, when I tried to run qmake on qtdeclarative, I got some weird errors:
/home/myname/raspi/qtdeclarative/src/src.pro:13: 'qtConfig' is not a recognized test function.
It keeps going on until:
Reading /home/myname/raspi/qtdeclarative/tests/auto/qml/debugger/qdebugmessageservice/qdebugmessageservice.pro
Project ERROR: Unknown module(s) in QT: qmldebug-private
I can't find anything on the internet about this, does anyone have an idea of what to do ?
The qtjsbackend requirement is old, and only needed for Qt 5.1. Newer qtdeclarative no longer use v8 as a JavaScript engine.
The error you are getting there is caused by a mismatch of version dependencies. You are trying to build a qtdeclarative that looks like it is from either a 5.8/5.9 or dev branch against a qtbase that you say is 5.6. If you have Qt 5.6, you want to build the same major & minor version for qtdeclarative, i.e. 5.6 (or a 5.6.x release)
I would suggest that you either use qt5.git to get you all the dependencies of the version that you need, or use the tarball releases which contain everything in one "blob".
Alternatively, you should be able to install it from your distribution. I would expect that it is already packaged there, though it may not be the newest version possible.
I faced same problem and tried following
Try checking out 5.7 branch from your git repo for qtdeclarative,
git checkout 5.7
then qmake, make and make install.
Hope this helps.
Cheers

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

Integrating QWT 6.0.1 with Qt Creator/Designer 4.8.0

I've installed the Qt SDK version 4.8.0 (to C:\QtSDK) on a Windows 7 64-bit machine. I've also installed and successfully compiled QWT 6.0.1 with MSVC2010.
I can use QWT in C++ code by linking to the libraries; however when I try to use the plugin I get an error that I can't seem to find on the Googles.
My failed plugin error is:
The plugin 'C:/QtSDK/QtCreator/bin/designer/qwt_designer_plugin.dll' uses an incompatible Qt library. (4.8.0) [release]
My QWTbuild.pri has CONFIG += debug_and_release
I built the plugin by doing:
C:\QtSDK\QWT\qwt-6.0.1\designer > qmake designer.pro
C:\QtSDK\QWT\qwt-6.0.1\designer > nmake release
I then copied the .dll generated (qwt_designer_plugin.dll) in C:\QtSDK\QWT\qwt-6.0.1\designer\plugins\designer to my plugin path for QtCreator (C:\QtSDK\QtCreator\bin\designer)
I've also put the .dll and the .lib generated in the Qt plugins folder (C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\plugins\designer).
I've also linked my libraries in the project file containing the form I'm trying to build.
I'm sure that there's something small I'm missing, but I can't seem to find it. What am I doing wrong here? Any help would be greatly appreciated.
Regards,
Alexis
The Qt plugins should use the same version of Qt or a lower version with the same major number as the application they are loaded in.
Since the Qt Creator currently included in the Qt SDK seems to use Qt 4.7.4, you should probably recompile Qwt for that version of Qt.

Resources