I'm working on a Embedded Linux application and I would like to use GDB to debug it. The problem is that, although the Kit configuration seems fine (the Debugger option is correctly pointed to the GDB correspondent to the device's GCC - device is a Linux ARM), when I ask Qt Creator to run in debug mode it returns an error in the "Application Output":
sh: gdbserver: not found
This seems strange since, as I sad, the configuration is fine and no error about that is reported by Qt Creator in any moment before starting debug mode.
I did some research on the web to find which was the exact steps to use GDB to debug an Embedded Linux application from within Qt Creator (to use breakpoints, etc.) and the closest thing to an answer I got was this commentary by Tobias Hunger:
You will need to have ssh and gdbserver installed on your board for
this to work. Then you need to set up your board [qt-project.org] in
Creator. Afterwards you need to set up a kit [qt-project.org] using
this device.
Those steps, thought, are not clear to me.
First, why would I need to have a GDB inside the device if the Kit should point to my local GDB?
Or it shouldn't?
Where would I put the GDB anyway?
How do I know if I have this ssh on my device?
If I don't, how do I install it?
All the other mentioned steps are already done, but related to the GDB located on my Desktop Ubuntu. Should I change something if I do the above steps?
And of course, is this manual my Tobias complete or do I need to do something else for this to work?
You need gdb and ssh on your Ubuntu and gdbserver and sshd on your device: actually when you deploy a project on a remote device using QtCreator, it makes use of ssh for copying the files to target, then it launches gdbserver on the device (attached to the executable that you want to debug) and then launches gdb on your Ubuntu connecting to the running gdbserver on the device.
So you need all of them to make things working.
ssh and gdb can be installed on your Ubuntu simply via apt-get. Instead the installation of sshd and gdbserver on your board is platform-specific: it can be that some boards already have them in their standard system image, or maybe in some cases it is up to you to install them... if your Linux distribution on the board has some package manager then you might try to use it... in the worst case you will have to compile them on your own for your board and install them manually.
Related
I've compiled Qt5.15.0 and set up cross-compiler on my host machine (Ubuntu 20.04) and managed to cross-compile a simple Hello World app for my Raspberry Pi 4, however, when I deploy and run it (tried both on Qt Creator and in terminal) I get Could not queue DRM page flip on screen HDMI1 (Invalid argument) I use latest Raspbian image and tried both with lite and full desktop versions.
There are some solutions suggesting to set the environment variables;
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
QT_QPA_EGLFS_KMS_ATOMIC=1
But I had no luck with setting them.
I don't know where the problem is, I'm very new to Qt.
For those who has the same problem here is how I solved;
Somehow I discovered that Raspberry Pi does not set the environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE. You can check that by typing
printenv QT_QPA_EGLFS_ALWAYS_SET_MODE
or
echo $QT_QPA_EGLFS_ALWAYS_SET_MODE
in both cases, you should see 1 as a result if you've set it so.
However I got no response when I typed them.
Then I went and opened .profile and added
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
at the end of the file and rebooted the system. Finally there it was, when I echoed the variable it returned 1, and my programs now work pretty well.
The variables should be set in:
/etc/default/qt
See QTBUG-72539 in the Qt bug tracking.
I am trying to build a cross platform (vista, xp, mac, Linux).
I need to put the application in the USB drive formatted in FAT-32 and it should run on any OS computers.
Planning to use Java/JavaFx to do it.
Any advice how we can run on the multiple platforms.
Hi, Can anyone advice use of uber-jar for the above requirment. Would that be good fit.
A few things to take into consideration:
The USB must be formatted with a filesystem compatible with all the OS you need to work with.
A Java application would be able to run on any OS that is able to run Java, but each OS needs a different Java runtime. There's a Java runtime for Linux, one for Windows, one for OSX, etc.
My suggestion would be to define which OS you want to support and create launcher scripts for each one of them on the root of the USB. For instance you would have at least a couple like: myapp.cmd (for Windows), myapp.sh (for Linux), etc.
Additionally you may want to have different Java Runtimes in the same USB, so with the launcher scripts you execute your Java application running it with the corresponding JRE in the USB filesystem.
A twist in the launcher script would be to somehow check if the OS has already a JRE available (Like checking for a variable JAVA_HOME in the environment, or checking the output of "java -version") and act accordingly (although, running a Java application from your own JRE would be safer).
if i try to run my qt application on windows 7, the console print:
QPSQL driver not loaded ... available driver:...QPSQL...
After that, i've tried to include the following paths to the windows path variable
C:\psql32\bin;C:\psql32\include;C:\psql32\lib;
The application can connect to the psql db and all works fine. How can i fix this problem, without to install the psql software on all pc's. ?
Best regards, chris.
Usually you don't need to use the drivers from Postgres. At least in the version I use (commercial, 4.8.4, Win)
Qt provides the drivers in the directory <QTDIR>\plugins\sqldrivers.
When the application runs on the computer, where Qt is installed, nothing should be done explicitly - Qt should find the drivers.
When the application is deployed on a computer without Qt-installation, I copy release versions of the files found in <QTDIR>\plugins to <MyAppExeDir>\plugins.
Besides Sql drivers, same problem could apply also to jpeg an other pluggable components.
P.S.:
Make sure, not to mix Qt-dlls from one computer with Qt-plugins from other computer, even if the versions are the same.
I am trying to hook my beagle board to qt creator 2.3.1 running on Ubuntu Linux. I tried to find a good tutorial for this and found that qt documentation has nothing on this.(I do not understand why there is a feature which documentation does not bother to explain how to use). Could some one please explain how to do this?
Cross compile qt for beagle board This post should be at help
Open Qtcreator and go to project tab and select the tools -> options. Select Linux devices and add the device. For this beagle board need to be attached. For the option of host name it is required to add the ip address of the device. Other than this other fields are self explanatory. Test Button would assist in checking the device addition.
Then in the project settings under Run configuration in the Deployment drop-down box select Build tar ball and install.
At this point tool chain and the cross compiled qt version should be added in the qt creator.
Basic procedure should be done by now and when the application is run it should be deployed on the device at the specified location.
I am developing OpenCL code on a linux cluster through SSH -
are there any tools that would make this process easier, i.e.
something like NVIDIA Parallel Nsight for OpenCL ?
No there is no such tool, though you might try developing your code using ordinary computer and post production versions there..
If the computer where you perform development is also running Linux, you can easily mount a remote folder as local. In a Gnome environment, open Nautilus (the file manager), click File => Connect to server, chose SSH, fill the required parameters, and you have a remote folder as local.
You can then use any IDE you want to develop code, and maybe perform simple runs, tests and debugs if the OpenCL tools (compiler, debugger) you're using remotely are also installed locally. However, To compile and properly run the code on the cluster, you need to use the ssh client on the command line.