Question is mainly on the title. Details are,
I am asked to convert a slightly old Qt project that is claimed to be compatible with 5.12, which seems it is not, to Qt 5.15 or higher. So, I am debugging errors and I saw,
#include <QtLocation/private/qgeomaptype_p.h>
...
QGeoMapType::MapStyle getMapStyle() { return _mapType; }
However, this doesn't work out in Qt 5.15.5. I googled the errors and can't get much.
Error output:
...MapProvider.h:35: error: Use of undeclared identifier 'QGeoMapType'
Okey, after a little more digging I realized that this file is in another directory in my system.
Qt\5.15.2\msvc2019_64\include\QtLocation\5.15.2\QtLocation\private
As you can see, because of 5.15.2 directory it seems Qt can't find the files. After I changed include path to
#include "QtLocation/5.15.2/QtLocation/private/qgeomaptype_p.h"
the filesystem can find it. However, now the problem is Qt can't find some files in qgeomaptype_p.h , all of them are missing QtLocation/5.15.2 prefix.
Related
I want to learn Qt especially for the 3D functionalities and therefore was following this tutorial.
One part of the tutorial is displaying the mesh from a .dae file called object.dae.
When I tried to run my code for the first time, I got the following error:
2:25:52: Starting /home/qt/build-Qt3DTests-Desktop_Qt_5_15_2_GCC_64bit-Debug/Qt3DTests ...
Qt3D.Renderer.SceneLoaders: Qt3DCore::QEntity* Qt3DRender::Render::LoadSceneJob::tryLoadScene(Qt3DRender::QSceneLoader::Status&, const QStringList&, const std::function<void(Qt3DRender::QSceneImporter*)>&) Found no suitable importer plugin for QUrl("file:../Qt3DTests/Models/object1.dae")
22:26:00: /home/qt/build-Qt3DTests-Desktop_Qt_5_15_2_GCC_64bit-Debug/Qt3DTests exited with code 0
I proceeded to clone the repo (tag: STEP_001) and try running it but again I receive the same error.
As this was the first Qt tutorial and C++ code I ever did, I am unsure what could be the problem. Does anybody know what is going wrong? Am I missing some module in my installation or something?
The cause might be this (rare) bug in Qt:
https://bugreports.qt.io/browse/QTBUG-89045
I'm trying to make static compile of my QT application. I almost've done it but there is one problem I can't resolve (I couldn't find any similar problem in google). Error looks like this:
path/libQt5Core.a(qthread.o):qthread.cpp:(.text$_ZN19QThreadCreateThread3runEv[_ZN19QThreadCreateThread3runEv]+0x57): undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)'
I've added "LIBS += -pthread" to my project file but it's still not working.
I'm working on Windows 8.1.
I'm trying to build a sample project using Qt 5.7 over Linux. Previously, the same project have been built with Qt 5.4.2 without issues. When I try with Qt 5.7, I get the followings errors:
undefined reference to `QJsonValue::toString() const'
I have tried installing Qt5.7 with Qt Maintenance Tool and also download from Qt official site and install it using .run file. When I run a locate to qjsonvalue I get the followings results:
$ locate qjsonvalue
/opt/Qt/5.4/Src/qtbase/include/QtCore/qjsonvalue.h
/opt/Qt/5.4/Src/qtbase/src/corelib/json/qjsonvalue.cpp
/opt/Qt/5.4/Src/qtbase/src/corelib/json/qjsonvalue.h
/opt/Qt/5.4/android_armv7/include/QtCore/qjsonvalue.h
/opt/Qt/5.4/android_x86/include/QtCore/qjsonvalue.h
/opt/Qt/5.4/gcc_64/include/QtCore/qjsonvalue.h
/usr/include/qt5/QtCore/qjsonvalue.h
/usr/share/doc/qt5/qtcore/qjsonvalue-members.html
/usr/share/doc/qt5/qtcore/qjsonvalue.html
According with the previous results, seems that I need to install something becuase qjsonvalue.h/cpp is not in my Qt5.7 core. Any ideas about how to solve it? Need to install anything else? As note, when I start Qt Maintenance Tool I get an alert message that says the following:
Your installation seems to be corrupted. Please consider re-installing from scratch.
Found this comming here via google. I had the same issue.
The API changed from a default argument
QString QJsonValue::toString(const QString & defaultValue = QString()) const
to two overloads.
QString QJsonValue::toString() const
QString QJsonValue::toString(const QString &defaultValue) const
You should build with the headers of the oldest version you want to support. But if you just need this one error fixed you can just change the call from
QJsonValue someval;
QString str = someval.toString();
to
QString str = someval.toString(QString());
But you will probably get some other linker error in the wake of fixing this one.
I tried to build qt 5.2.1 (opensource.zip) on a Windows 7 64 bit machine with Visual Studio 2005 Professional while having ActivePerl etc. installed. I used the Visual Studio 2005 Command prompt with the following line for configure:
configure -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2005 -opensource -nomake examples
which ends up in the following output after about 2 min.:
…
qglobal.cpp
qmalloc.cpp
qlibraryinfo.cpp
qnumeric.cpp
qlogging.cpp
D:\qt-source5.2.1\qtbase\src\corelib\global\qlogging.cpp(96) : error C3861: “GetConsoleWindow”: identifier not found.
Code will be generated…
NMAKE : fatal error U1077: ““C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\cl.EXE”“: return code “0×2”
Stop.
Building qmake failed, return code 2
I also tried to do just a simple:,
configure
within Visual Studio 2005 Command Prompt -> Ends up in the same error.
Does anybody know what wents wrong here? Am i doing something totally wrong or missing something?
I also posted this to the qt Forums of a thread created by a user who had a similar problem -> http://qt-project.org/forums/viewthread/36177/
But nobody replied there.
EDIT: Today i updated my question in QT forums. See -> http://qt-project.org/forums/viewthread/36177/ I modified the problem file qtbase\src\corelib\global\qlogging.h and added the following on top of it:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0×0500
#endif
I found this solution while searching for “getConsoleWindow” problems. The reference is written down as remark here -> http://msdn.microsoft.com/en-us/library/windows/desktop/ms683175(v=vs.85).aspx
After this my configure runs fine without any problems. But now I expected the following error after calling nmake. After nmake runs ~30 mins i got this output:
d:\readonly\qtsrc\qtbase\include\qtcore\../../src/corelib/tools/qvector.h(666) : error
C2244: 'QVector<T>::erase' : unable to match function definition to an existing declaration definition 'QVector<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator,QTypedArrayData<T>::iterator)'
existing declarations
'QTypedArrayData<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator)'
'QTypedArrayData<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator,QTypedArrayData<T>::iterator)'
There are some more errors but all with QVector::insert and QVector::erase. I Googled a bit and found this post here which looks like a similar problem and is also not replied yet: http://qt-project.org/forums/viewthread/36735
I think i have to say that i compile for custom ce sdk. So i changed the qtbase\mkspecs\wince60standard-armv4i-msvc2005\qmake.conf and added additional includes and libraries there. I also use the following defines there:
DEFINES += WINCE WINDOWS WINDOWS_CE_OS _WIN32_WCE=0×600 UNDER_CE=0×600 ARM _ARM ARMV4I UNICODE UNICODE _USE_32BIT_TIME_T _CRT_SECURE_NO_DEPRECATE $$CE_ARCH _AMRV7 armv7 ARM QT_NO_CLIPBOARD QT_NO_ACCESSIBILITY QT_NO_NATIVE_GESTURES QT_NOSTANDARDSHELL_UI_MODEL
Is it so hard to compile qt 5.2.1 for ce? Should i use an older version of qt (i need at least qt5 for JSON handling)? Any suggestions regarding this issue here?
Use thirdpaty library for JSON. Visual Studio 2005 is too old compiler. For example - jsoncpp or QJson.
My project is using both Qt (included Qwt) and Boost::signals. As known, their macros are incompatible with each other. I compiled my project with CONFIG += no_keywords and renamed all Qt macros with upper-case registry i.e. signals = Q_SIGNALS. There are no more errors in project, but now I have errors in Qwt includes like this
/usr/include/qwtplot3d/qwt3d_extglwidget.h:101:1: error: ‘signals’ does not name a type
/usr/include/qwtplot3d/qwt3d_extglwidget.h:116:8: error: expected ‘:’ before ‘slots’
/usr/include/qwtplot3d/qwt3d_extglwidget.h:116:8: error: ‘slots’ does not name a type
It seems that Qwt is still conflicting with Boost::signals. What can I do here?
Qwt is compatible with boost signals - you are talking about a lib called QwtPlot3D !
When you want to use boost signals with QwtPlot3D you have to patch its implementation replacing the signal/slot/emit macros like you did it with your code.