I'm trying to cross compile Qt Quick Designer Components to get QtQuick.Studio.Effects module on Qt 6.5 on arm64 target as I'm getting "module 'QtQuick.Studio.Effects' is not installed" when I try to to run my cross compiled qt application.
So far I have cross compiled Qt Quick Designer Components with help of this and it outputs libQuickStudioEffects.a static library. I tried to link it in .Pro file by adding the library with qt creator which generated following lines.
unix:!macx: LIBS += -L/home/user/qt/ -lQuickStudioEffects
INCLUDEPATH += /home/user/qt/
DEPENDPATH += /home/user/qt/
unix:!macx: PRE_TARGETDEPS += /home/user/qt/libQuickStudioEffects.a
lib file and executable both are in /home/user/qt/ location in target and host pc.
also I tried with following line.
LIBS += /home/user/qt/libQuickStudioEffects.a
So far executable is not detecting the lib file and giving me the above mentioned error. I can run other cross compiled qt6 programs on my target device without any issue. My host runs Ubuntu 20 and target runs on debian 11. Any help is really appreciated. Thanks.
Build the dev branch from here and it will give the dynamic QtQuick.Studio.Effects library which can be cross compiled.
Related
I have a desktop(ubuntu 14.04 64 bit) QT application which uses libpqxx(c++ library for Postgres). The GUI app is an interface to the postgress database and does a lot of operations. Now, I am trying to port this application to a raspberry pi3. I started with a test QT app. Used cross-compile tool chain to build the test app on desktop and deployed it on pi. It works like a charm. However, when I follow the same steps to deploy my actual app on pi, its giving me compile time error
fatal error: pqxx/pqxx: No such file directory.
I have the library linked in .pro file via -lpqxx -lpq. I have also installed libpqxx on pi3. It works on my desktop with Qt 5.6.1 GCC 64 bit kit but doesn't work on pi with Rpi3 Qt kit. Please help.
New Edit:
I added pqxx library path in my .pro file. It looks like this now :
target.path = /home/pi
INSTALLS +=target
unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lpqxx
INCLUDEPATH += $$PWD/../../../../../../usr/local/include/pqxx
DEPENDPATH += $$PWD/../../../../../../usr/local/include/pqxx
unix: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/libpqxx.a
The previous error is gone. However, it gives me this error now:
/home/pragya/ep/PHOENIX/GUI/LUXE_GUI/../../../../../../usr/local/lib//libpqxx.a: error adding symbols: File format not recognized
Any Ideas?
I am in the exact situation described in this question (Qt Creator on Mac and boost libraries) but the accepted answer is not working for me. I've searched around and tried all the suggestions I've found but I still end up with errors
Environment:
OSX 10.9.5
Qt 5.5.1 - Qt Creator 3.5.1 - installed using the Qt
installer
Boost 1.59.0 – installed through Homebrew
Am able to compile and run Qt apps
After creating a new Qt test application, when I add the Boost information to the .pro file (shown below) as described in the question linked above, I end up with very confusing compile errors within the Qt classes. I don't get it. Does anyone understand the conflict and know how to resolve this – I've been at it for hours now.
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = audiowaveform_test
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
macx {
QMAKE_CXXFLAGS += -std=c++11
_BOOST_PATH = /usr/local/Cellar/boost/1.59.0
INCLUDEPATH += "$${_BOOST_PATH}/include/"
LIBS += -L$${_BOOST_PATH}/lib
## Use only one of these:
LIBS += -lboost_chrono-mt -lboost_system # using dynamic lib (not sure if you need that "-mt" at the end or not)
#LIBS += $${_BOOST_PATH}/lib/libboost_chrono-mt.a # using static lib
}
I finally got it working by changing this line in the .pro file:
QMAKE_CXXFLAGS += -std=c++11
to this:
CONFIG += c++11
If someone can explain what -std means in compiler speak, I would appreciate it. Does it mean that everything should be compiled as c++11?
I developing a GUI app with Qt 5.1 and QtCreator 2.8.0 and I'm using a shared library (also compiled with Qt 5.1).
This is what I'm using in the .pro file:
INCLUDEPATH += ../MyLib
QMAKE_LIBDIR += ../MyLib/build/release
LIBS += -lMyLib
Regarding the "Run Configuration" (QtCreator) and under Linux (Ubuntu 12.04) I set the LD_LIBRARY_PATH to "(...)/MyLib/build/release" and it works well. However, on Windows, appending the library path (.dll) to PATH doesn't work. I don't get any compiling nor linking errors but when I run the app it immediately exits. If I put the .dll on the same folder as the executable it runs without any problem. Am I missing something?
Hard to say from the information you gave. Surely Windows does find the dll if you put its path into PATH. But maybe your dll uses another dll, which is not in the normal search path?
You might want to try the dependency walker: http://www.dependencywalker.com/
If your dll is based on Qt it might be that it does not find necessary qt plugins.
Check this out: http://qt-project.org/doc/qt-4.8/deployment-windows.html#application-dependencies
Qt 4, but Qt 5 is the same in this regard.
A problem with a Qt *.pro file:
TARGET = ProgName
TEMPLATE = app
CONFIG += console
QT += core
QT += gui
LIBS += -LC:\\Qt\\4.8.5\\bin
LIBS += -LC:\\Qt\\4.8.5\\lib
LIBS += -LS:\\lib
# LIBS += -lQtCored4 # not necessary
# LIBS += -lQtCore4
# LIBS += -lQtGuid4
# LIBS += -lQtGui4
SOURCES += ...
HEADERS += ...
I get these linker errors:
:-1: error: cannot find -lQtGuid
:-1: error: cannot find -lQtCored
collect2.exe:-1: error: error: ld returned 1 exit status
All the DLLs exist in the specified directories.
The documentation did not help much.
This pro file worked a few days ago, and it seems to have issues since I installed Qt 5.1 (this is not used, yet; I am still working with Qt4).
Platform: Windows 7, MinGW, Qt 4.8.4
You only need the following content:
TARGET = ProgName
TEMPLATE = app
CONFIG += console
QT -= gui
SOURCES += ...
HEADERS += ...
That is because core and gui are added to the QT variable automatically. In this particular case however, you can remove the gui default if you wish to build a console application as you seem. Although "CONFIG += console" could eventually do that for you. Besides this, everything will work automatically for you, so you do not need to pass the library path to the qt libraries and so forth. You would only need to use QT += widgets and similar lines if you used further Qt modules there are not there by default. Even then, you would not need to set the Qt library path as you did in your question.
Besides, if you wanna target cross-platform later, you may wish to add this:
CONFIG -= app_bundle
to avoid creating Mac bundle for console based applications.
If you have multiple versions of Qt installed as it seems, you need to use the qmake from the required version, and it will be fine. Just to give an example: I use qmake for Qt 5 on my Archlinux system, and qmake-qt4 for Qt4.
On windows, you should either have the desired qt installation bin in the path before the undesired, or you need to call desired qmake explicitly, something like C:\path\to\my\desired\qmake.
There's no need to link to any Qt libraries afaik.
If you're using Qt Creator you need to make sure Qt 4.8.4 is properly recognized in Tools - Options - Build & Run - Kits. Since you installed 5.1 this may no longer be true. Then set the 4.8.4 kit for your project and compile it (cleaning the build directory also helps sometimes).
I have managed to compile PortAudio on windows using MSYS.
this process has created 2 files: libportaudio-2.dll and libportaudio.dll.a
Now i want to link the libraries in QtCreator, but i can not since it requires a .lib file.
If anybody have experience of compiling and using libraries with MSYS under windows, your input is appreciated.
(Note: they are compiled using MindGW compiler. I dont want to compile it with Microsoft Visual Studio, since then i will have to compile QT)
to solve your problem is very simple. Here I report an example of a file. pros who need to use:
QT += core
QT -= gui
TARGET = mioTestAudio
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
LIBS += -lportaudio.dll <-------- this is the part you are interested
SOURCES += main.cpp