I've got this qt app1 that I've cross-compiled using cmake and openembedded. It's cross-compiled from i686 to geode, so I figure I should be able to run it on the i686 host I compiled it on, if I link against the geode libraries. As you can see from the image, it doesn't run quite right. Using strace seems to indicate that qt is using some funny encoding for everything, e.g.:
stat64("\342\274\200\347\200\200\347\210\200\346\274\200\346\214\200", 0x869566c) = -1 ENOENT (No such file or directory)
Any ideas?
Thanks,
Jayen
When you cross-compile, it means you create a binary that will run on a different architecture from what you compiled it on. In your case, this means you've used your i686 machine to build a binary that's supposed to run on geode architecture. Your app is finding the Qt libraries on your computer and that is why it runs. However, when Qt built your app, it converted some code to be geode specific, thus it's not "really" working.
If you tried this with a non-Qt app, you'd get an error when you tried to run this.
To test out your cross-compiled app, you'll have to run it inside Qemu that supports geode arch. OpenEmebedded usually provides a Qemu target. Check the available targets for geode, there should be one for Qemu. Once you've done that, you can include your app to be part of the Qemu image that get's generated, or copy it over yourself into the Qemu image, and then you can run it.
The problem turned out to be that when I compiled qt, because I had already compiled libiconv, qt was using that, instead of gconv (iconv in glibc). When I went to run it, it was using the cross-compiled libiconv, so I'm still not sure why it didn't work.
Wiping my cross-compile clean, and compiling qt without libiconv worked just fine.
I've since managed to get this running on a x86_64 host as well.
Related
So I just migrated a working application from Qt 6.1.2 to Qt 6.4.2. Pressed play in QtCreator and everthing ran, particularly the connection to a remote server which is done via HTTPS. I use QSslSocket::supportsSsl() to check that everything is ok with SSL and if it's not I close the application. So the fact the application opens means that everything is where it is.
I do however get this in the QtCreator console:
qt.tlsbackend.ossl: Failed to load libssl/libcrypto.
However it does work fine. I have tested.
Once I have this working I run windeployqt by doing
PATH/TO/windeployqt --qmldir PATH/TO/qmldir PATH/TO/myapp.exe
It runs and no errors. But now the application won't run neither from QtCreator (pressing play) nor from double clicking the executable. QtCreator console now throws THIS error:
qt.network.ssl: No functional TLS backend
I made sure that the libcrypto and libssl libraries (the same one in the OpenSSL directory installed by Qt Maintainer and in the bin directory of QtCreator) are in the executable's directory.
But I have no Idea why it is not working anymore. This exact same process worked on Qt 6.1.2 with no issues.
Any ideas?
EDIT: UPDATE: So I've been fooling around. And I found the following interesting tidbit. If I delete the QtCore6.dll from the executable directory where I ran the windeployqt, then I can launch the application from QtCreator again. I don't know if this helps anyone help me, but I'm putting it here just in case.
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.
I am trying to install kde-connect following this.
Although my kubuntu version is 14.04, I wanted to compile them so that I can have the latest version. But when I followed the instructions to compile, i get the following error.
-- Found Qt-Version 5.2.1 (using /usr/bin/qmake)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QT_QT_INCLUDE_DIR
used as include directory in directory /home/vinaychandra/Downloads/t/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1311 (message):
Unable to compile a basic Qt application. Qt has not been found correctly.
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindKDE4.cmake:95 (find_package)
CMakeLists.txt:7 (find_package)
Please point out how to correct this.
I have tried giving -DQT_QT_INCLUDE_DIR=/usr/share/qt4/
then it tells that You must build your code with position independent code if Qt was built with -reduce-relocations.
Your cmake by default uses a different QT version.
So, you must explicitly tell him which version of QT he have to use for this job.
This one
-DQT_QT_INCLUDE_DIR=/usr/share/qt4/
Is wrong because you mustn't give QT position explicitly.
All you need is to use the right qmake.
So, give'em this flag and you'll be happy!
-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
Since most of kde applications are not ported to Qt5, you need Qt4.x for building kdeconnect(don't know x, mine is 4.8.6).
Also Qt4 installer is not available (I think !), so you have to build it also from source. Building Qt4 is quite easy, just download the source and run the usual commands.
After building it, it qmake name will be qmake-qt4 in /usr/bin.
So for building kdeconnect, first run its cmake, then a Cmaketextcache.txt file will form.
In that change the path of qmake (i.e somewhere written /usr/bin/qmake to /usr/bin/qmake-qt4) and also the path of qt include dir to (I think /usr/include/qt5 to /usr/include/qt4), and run the cmake again.
If some packages are missing, then you have to install it.
But with the above changes, you will get a make file to install it.
Unfortunately, the cited documentation is lagging behind the current state of kdeconnect. I ran into similar problems but I managed to solve them by installing the following required packages from the Kubuntu repositories:
sshfs
libfakekey-dev
libxtst-dev
libqca2-dev
libqjson-dev
I trust these are all of them. I installed kdeconnect from the latest git commit and it seems to run fine.
This answer comes a bit late, but this is the first Google search result for the question. In systems with qtchooser (Kubuntu, Ubuntu at least), this can be fixed by running first:
export QT_SELECT=qt4
This makes all of the Qt build tools to default to the Qt4 version instead of Qt5. You can check which Qt version is active by running:
qmake --version
Try kde connect install on ubuntu: https://fazlerabbi37.github.io/blogs/install_kde_connect_in_ubuntu_18.04.html
(in 18.04 & 19.04 it works with simple sudo apt install kdeconnect
Install kde connect on android device (google play store is where I installed from)
Invoke kde connect from desktop
Invoke kde connect from android and search device.
Your ubuntu will be found / initiating a search from desktop results in android phone pulled up for pairing
Accept pairing request
Provide access to folders
Try clicking on a video/image file for transfer
I could see the new file transferring in /Downloads folder of desktop
allowing/disallowing desktop to access sms, notifications etc are now a choice
Note: Pl treat this with pinch of salt. This appears very simple, effective for a main reason it worked for me in no time.
I'm trying to get Qt applications running on QNX 4.5. I've compiled Qt 4.6.3 on a linux box with this configuration:
./configure -xplatform unsupported/qws/qnx-i386-g++ -embedded i386 -no-gfx-linuxfb -no-mouse-linuxtp -no-kbd-tty -no-qt3support -qt-gfx-qnx -qt-mouse-qnx -qt-kbd-qnx -no-exceptions -little-endian -nomake demos -nomake examples
"make" required certain tweaking of environment and commenting out one function, but worked in the end. I've copied fonts and compiled Qt libraries onto QNX running in VMware, and created a sample Qt app (it just displays a button) which I compiled on my linux box and copied over to QNX.
I have a little script to launch the app:
io-display -d vid=0x15adh,did=0x405h
/usr/photon/bin/devi-hid -Pr kbd mouse
./app
Which runs the application, enabling experimental input drivers. With this script I was able to get somewhere by running the Qt app in Photon - screen rendering gets all screwed up, but I do see my Qt application.
However, if I exit Photon into a text mode, and try to run the application from there (using a slightly modified script with different vid and did values for launching the graphics server), I just see a blank screen.
I'm completely new to QNX and Qt, so I'm a bit stuck right now. I'm trying to read up on how Photon works and what kind of environment it sets up, to find what I might be missing in the text mode. However, I'm not sure this is even a right direction, so I thought I'd ask good folks on SO, in case somebody went through this before :)
cheers!
Have you tried adding "-qws" after you app? It tells the Qt app to initialize it's windowing system (qws). Only 1 qt app needs (or may have) the option specified.
I would also add a couple of environment variables to help Qt to know where to find your keyboard and mouse. (I also am not sure if you really need the first line.)
io-display -d vid=0x15adh,did=0x405h
/usr/photon/bin/devi-hid -Pr kbd mouse
export QWS_DISPLAY=qnx
export QWS_MOUSE_PROTO=qnx
export QWS_KEYBOARD=qnx
./app -qws
BTW, QNX has just released a port of Qt 4.7.1 for QNX 6.5. It can be found on the Foundry 27 Qt Project site.
I'm trying to install Qt-4.6.0-wince on XP and Vista. I read the instructions and follow it to install.
However, I can't install it successfully due to some fatal errors on all of the two machines. I think the problem is that qconfig.[h cpp] files are not created automatically during the configuration.
I already report about this problem, so you can see the more information here. However, it is still remained as unresolved.
Anybody here who has been installed it successfully?
#KernelJ I believe the original poster is using the correct install distro - the final product will be cross compiled from Win32 to WinCE; as is pointed out in the Qt for Windows CE Requirements.
#Brian, Unfortunately, I can't answer your original question - I have had unrelated trouble with the WinCE distribution myself and am working the issues now. However, I can provide some help: I was able to get the Qt Everywhere 4.6 to cross compile on my Win32 (XP) host for WinCE. I used the commercial version, but here is a link to the Open Source Qt Everywhere 4.6 package. As is pointed out in the nokia instructions, make sure to use the Visual Studio command prompt, get your environment variables ironed out, create a custom mkspec (if you have to), and keep a close eye during the configuration for any warnings.
Good luck.
Qt-4.6.0-wince, as is implied in the name and said explictly on the page you linked, is for Windows CE, NOT for Windows XP and Vista!!!
Nokia have released a nice software development kit for Qt which you can download here. It is very impressive and powerful!
I got things running as compilable (and running on emulator) with VS 2008, so your milage may vary:
Make sure the PATH variable points to \bin
Open a command prompt (using the Visual Studio Command Prompt)
Run the vcvars32.bat file (in C:\Program Files\Microsoft Visual Studio 9\VC\bin) folder
Cd into the qt folder
Run this: configure -no-sql-sqlite -no-qt3support -platform win32-msvc2008 –xplatform wincewm50pocket-msvc2008 -no-phonon -no-phonon-backend -no-webkit (building for WINCE 5.0, and all the '-no-...' makes it build faster, removing stuff we don’t want)
The setccepaths script provided sometimes doesn’t work. I used checksdk.exe –script temp_script.bat (It creates a script, the default is for Pocket PC SDK 5)
Run that script you just created (the temp_script.bat thing. It sets up environment variables.
Run nmake
*whew*
and good luck.