I am pretty new to setting the Qt Creator environment in Linux.
I will cross compile this demo program to the Yocto Project i.MX6. This demo program needs to use Qt-GStreamer
in demo.pro
There is these 2 lines
CONFIG += link_pkgconfig
PKGCONFIG += Qt5GLib-2.0 Qt5GStreamer-1.0 Qt5GStreamerUi-1.0 Qt5GStreamerUtils-1.0 Qt5GStreamerQuick-1.0
at compile in the Desktop, it shows
error: Qt5GLib-2.0 development package not found
This applies to all the other packages as well.
I know that it tells me that I am missing the package for the Qt Gstreamer.
However, when I look at this thread, the answer is
export PKG_CONFIG_LIBDIR=/home/anisha/Desktop/newGSTr/qt-gstreamer-0.10.3/lib/x86_64-linux-gnu/pkgconfig
But, from what I have downloaded in Qt Binding-GStreamer qt-gstreamer-0.10.3 Does not have the lib folder inside.
I have also used cmake to work with the CMakeList.txt inside the folder but encounter Qt missing packages error.
Could someone help me on setting up those packages?
Related
I try to cross-compile qt chart example for a yocto platform. I do following steps to compile my qt programs:
source /opt/myimage/2.1.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
qmake -o Makefile areachart.pro
make
But When I add QT += charts to any project run qmake like qmake -o Makefile areachart.pro I hit this error:
Project ERROR: Unknown module(s) in QT: charts
Here is the output of qmake -v:
QMake version 3.0
Using Qt version 5.7.0 in /opt/myimage/2.1.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib
Should I add qtcharts module my yocto SDK to be able to compile the example? if yes how?
For some reasons I was able to cross-compiled Qt from source using qtcreator and get the binary files for qt examples and qtchart library itself. I also run the qt examples on my target platform by putting resulting libQtCharts.so and other files manually in /usr/lib/ and /usr/include/ on the target and I was able to draw the charts on target.
However, what I need is to include the charts in my project and run qmake steps as mentioned above. But what I get is the Project ERROR: Unknown module(s) in QT: charts
I have tried to put libQtCharts.so which I got from compiling qt source manually in /opt/myimage/2.1.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib but still not able to get the make file with qmake -o Makefile areachart.pro
As you pointed out, you need qtcharts package (also with qtcharts-dev to be precise) in your SDK. You also need qtcharts package on your target (i.e. in your image), otherwise the runtime library will be missing when you will execute your binary on the target.
The addition of the package depends on the method of building the SDK. The preferred one is a populate_sdk task, so I will describe it here (it will also add the package to your target).
The command to build the SDK is bitbake your_image -c populate_sdk. Add following lines to your_image.bb recipe to add the qtcharts package to the image (line 1) and other Qt5 stuff for SDK (line 2).
IMAGE_INSTALL += "qtcharts"
inherit populate_sdk_qt5
You can also put these lines into your_image.bbappend if you don't want to edit the image recipe directly.
The inherit populate_sdk_qt5 is specific (and required) for Qt5 packages, because other stuff is needed for SDK (e.g. qt.conf, some tools).
Since there is no real tutorial on the internet except for a very few similar questions that have had no answer, how do I incorporate gstreamer into Qt on Windows 7?
I have installed gstreamer throught the installer; then i copied the whole folder into my Qt project folder and put this line in the main:
#include <gstreamer/1.0/x86_64/include/gstreamer-1.0/gst/gst.h>
The compiler suggests gst_init, which means it can read gst.h, yet when I build the copiler gives this error:
C:\ ..path here...\Qt\BachelorProject_AUDIOVIDEO_STREAMING\gstreamer\1.0\x86_64\include\gstreamer-1.0\gst\gst.h:27: error: C1083: Cannot open include file: 'glib.h': No such file or directory
What am I missing?
EDIT: by adding this in the .pro file (as suggested by the gstreamer webpage) and compiling with cmake:
CONFIG += link_pkgconfig
PKGCONFIG += QtGStreamer-1.0
doesn't work either. It really seems that no "official" solution is available online
You can use pkgconfig which can be used inside Qt project (*.pro) file like
PKGCONFIG += gstreamer-1.0 gstreamer-1.0-app
If I remember correctly..
And you can link other dependant libraries like glib (GStreamer is based on GLib)
Of course you will have to provide correct path to the gstreamer .pc files which contain correct paths to where it is installed - you just keep gstreamer at the default location and it (maybe) should work..
I hope this approach is working on Windows..
I have a QT5 Project on Linux using taglib. It compiles fine inside QtCreator and runs flawless under Linux.
Now I want to Crosscompile the code using MXE. I've downloaded and "installed" MXE according the docs. I did a "make" for making all libraries crosscompiled. I also set my PATH as described in the docs.
the qmake run makes no errors, but when i "make" the project, the compiler complains:
./tagprocessortaglib.h:12:21: fatal error: fileref.h: No such file or directory
#include <fileref.h>
^
compilation terminated.
fileref.h is one of the library headers used by taglib, its furthermore the first of 3 includes of that lib.
In my .pro file, this two lines were added by QtCreator as i included the library for linux:
unix: CONFIG += link_pkgconfig
unix: PKGCONFIG += taglib
Are there any configurations to do for the library that I've missed? Any help is welcome! Thanks in advance!
Solved the issue:
I applied the Solution posted here: Compiling QT project for win32 target on Linux PC with larmadillo
and added the path to the library, this works for the MXR compiler run, but i have to remove it before native compiler runs.
I wanted to ask about an error I got when compiling opencv for windows7, I am following this
http://www.laganiere.name/opencvCookbook/chap1s1_2.shtml
and I have gotten to the part where both configure and generate commands on cmake are successful, but
when using mingw32-make command in the directory where cmake builds opencv, I am getting the following error:
fatal error: QApplication: No such file or directory
this happens in the file windw_QT.h which is located on the sources folder in openc, my exact path is
C:\Users\lenovo\Desktop\OpenCV248\opencv\sources\modules\highgui\src\window_QT.h
to be honest I could handle the cmake errors when it didn't know where to find the QT libraries, but I have no idea why compiling the sources yields this error, isn't QApplication supposed to exist in the very same folder as highgui.h
Based on your comment, you seem to have used cmake 2.6 for dealing with Qt 5. If you take a look at the Qt 5 cmake manual, you can see that you would need at least 2.8.3, but 2.8.11 is recommended:
CMake is a 3rd party tool with its own documentation. The rest of this manual details the specifics of how to use Qt 5 with CMake. The minimum version required to use Qt5 is CMake 2.8.3, but 2.8.11 is recommended.
Once you update, this all should start working.
I'm interested in using Yaml in my media player project. The only problem is I can't figure out how you compile with Yaml, especially on qt-creator. The AUR package for yaml-cpp doesn't seem to install the libs in /usr/lib for some reason, so I'm not sure how to go about doing this. I'm using Qt and developing within the Qtcreator environment. Help would be appreciated.
I used QtCreator to start a CMake project, then used a CMake file to find yaml-cpp. Here is the CMake file to link yaml-cpp to your project.
Additionally, you should be able to go into your ".pro" file, r-click, and hit "add library". Select "system library", then you can use either pkgconfig or manual if you know where the lib is. If you can't figure out where it is, look in the PKGBUILD for yaml-cpp - it will tell you where it installs everything.