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.
Related
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.
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 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 load new colorschemes in xml format from here and here
, so I copied the xmls to ~/.config/QtProject/qtcreator/styles, but when I go under Tools->Options->Text Edito->Color Scheme I get blank options under IntelliJ IDEA for each xml I added and when I choose one nothing changes. Also, when I try to change stylesheet with command
qtcreator -stylesheet=~/Downloads/stylesheet_1.css
I get
QCss::Parser - Failed to load file "~/Downloads/stylesheet_1.css"
QCss::Parser - Failed to load file "~/Downloads/stylesheet_1.css"
void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "Follow Symbol Under Cursor" under id 151
But the style changes nevertheless
I'm running Qt Creator 3.0.1(Qt 5.2.1) on Ubuntu 14.04LTE
This worked for me
Instead of
~/Downloads/stylesheet.css
Use absolute path
/home/username/Downloads/stylesheet.css
Cheers,
I'm a newbee to AIR and Flex, and I've been having trouble using amxmlc to compile a .mxml file from the command line. Specfically, I am getting the following error:
Error: Unable to locate specified base class 'spark.components.WindowedApplication' for component class 'DesktopClient'.
Googling has informed me that this is commonly the result of attempting to use mxmlc to compile an AIR project, and all the solutions I have yet found suggest to use amxmlc instead. However, that is what I am already doing.
This is how I am using amxmlc on the command line:
/Users/samreha/Documents/Apache\ Flex/bin/amxmlc -library-path /Users/samreha/Documents/Apache\ Flex/frameworks/libs/air/airframework.swc -- DesktopClient.mxml
A WindowedApplication is an AIR specific component. You are essentially trying to compile an AIR application with a Flex compiler.