Running qt creator via remote desktop - c++

We are developing a software using QT creator. The software is meant to run on windows and on an ARM mini-computer running Debian. To test the software on the mini-computer, we logged in on the mini computer using ssh and an exported display. Some programs like Inkscape run fine, but we can't get to run QT Creator. It always displays the following errors:
No tool chain set from kit "Desktop".
No tool chain set from kit "Desktop".
Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
Could not initialize OpenGL
We also tried to log in from another x86 linux computer, but this created the same errors. Thus we suppose that the problems are linked to the architecture. Does anybody know how to solve this issue?
EDIT: We just tried to access QT creator from another ARM Debian mini-computer and it also fails. Thus it does not seem to be related to the architecture as we first suspected.
(We could of course do cross compiling and remote debugging, but we try to avoid this)

Try loading qtcreator without the Welcome addon:
qtcreator -noload Welcome
The Welcome addon uses OpenGL which probably isn't supported by X forwarding.

Related

Qmake on Windows

I have a project written in Qt that I have no problems compiling and running on Linux. The command line is:
qmake ../trunk/GSDTesting.pro
The process on Linux was really simple: install a few dependencies using apt and you are off.
My task is to recompile the same program on Windows using Visual Studio C++ compiler, but the problem is I don't know how to start. There is no such thing as qmake for Windows.
Can someone give me a few hints where to start. Please note that I don't know QT almost at all, my task is just to debug some issue unrelated to QT.
Are you using terminal exclusively on Windows? If so, maybe this image of example build steps straight from Qt Creater 4.14.2 may help you:
As you can see the image of the default Qt creator build steps list the file path where 'qmake.exe' can be located on a local installation of the toolchain.
If you can use a machine with a display I find using the Qt creator GUI is not all that bad.
Here is a link to the base get started page:
https://doc.qt.io/qt-5/gettingstarted.html
Here is a link to the installer download page:
https://www.qt.io/download
IMPORTANT:
You will need to make a Qt account, login to your account, and then download the open-source version of the API. The commercial version of the same source is acquired differently/seperately.
Otherwise, if you cannot use the GUI, can I request some clarification on why you cannot use Qt creator on your Windows installation?

No SSL access from Qt C++ application run outside of QtCreator but access running inside it?

I am running Linux Mint 18.3 and QtCreator (Qt version 5.15 installed from Qt installer download from Qt site, not repository binaries for the distrubution) and developing a C++ GUI application. Because of the openSSL mismatch between native Mint SSL version and that used by Qt5.12 onwards, I have installed the OpenSSL1.1.1d binaries via the Qt Maintenance Tool and have explicitly added these libraries to my application project.
Without this step nothing works. With this step, my application runs successfully when initiated WITHIN QtCreator, but not when I just run the binaries outside of it.
I know that I must be missing something simple here, but what is QtCreator doing that enables access to SSL? I have tried creating simlinks to these libraries (libcrypto.so.1.1 and libssl.so.1.1) locally within the binary directory but this has no effect.
I would like to be able to run my application without having to do so inside of QtCreator but so far I can find no workaround to allow this. Can anyone suggest what I am missing?
I can confirm that the output of calls to my QSslSocket::sslLibraryVersionString() function are returning empty string and "OpenSSL 1.1.1d" respectively, so I am convinced this is a runtime linking problem.

Cannot run Qt Creator GUI outside of Qt. "The application was unable to start correctly (0xc000007b)" error

I downloaded C++ code from GitHub to tag images for training an object detector using Machine Learning.
Within Qt Creator 4.2.1 Based on Qt 5.8.0 (MSVC 2015, 32bit), I was able to compile and run the code. Unfortunately, I was not able to run the .exe outside of Qt Creator.
Initially, I received an error that
"The program can't start because libgcc_s_dw2-1.dll is missing".
Thanks to
QT The program can't start because libgcc_s_dw2-1.dll is missing, that was fixed easily by adding
"QMAKE_LFLAGS += -static"
to the .pro file. Now, when I run it I get
"The application was unable to start correctly (0xc000007b). Click OK to close the application."
I was able to reproduce the error using the simple "Hello World" default project that appears when you create a Qt Widget Application. This led me to believe something was wrong with my installation.
Based on the advice of this article: https://stackoverflow.com/questions/12099117/32-bit-qt-application-on-win-7-x64-wont-run-but-runs-fine-from-qt-creator, I used Dependency Walker to identify possible causes. I expected to see only a few items that I can follow up on. Instead, I received a list of close to 100 missing .dll files. All the files started with
"API-MS-WIN ###.DLL" or "EXT-MS ###.DLL"
where ### represent some additional text characters, for example;
"API-MS-WIN-SHCORE-STREAM-WINRT-L1-1-0.DLL"
I'm attaching a sample output.
Another suggestion was to copy over
libwinpthread-1.dll, libstdc++-6.dll, libgcc_s_dw2-1.dll.
That did not work either.
My next move was to simply get the latest version of QT and wish for the best. I installed Qt Creator 4.8.1 Based on At 5.12.0 (MSVC 2015, 32 bit). This time, I could not even get the code to run in the IDE. I received 1000+ error messages!
Based on advice from several pages, I added
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
to the .pro file and it still would not compile.
Also, I verified that the application is being built as a 32bit application. I'm running on a 64 bit Windows 10 system.
If anyone would like to take a crack at it to see if they can create a working .exe, here is the link: github.com/clavicule/BBTag
Qt provides a tool to copy the necessary dlls to the folder of your executable.
The tools is called windeployqt.exe and comes with your Qt installation. For me it is located at C:\Qt\5.9.1\msvc2015_64\bin\windeployqt.exe. You will have to look at your installation path and probably the msvc_32 folder to find it.
Then you go to the folder with your executable in it, oben a command prompt or powershell and execute path\to\windeployqt.exe yourProgram.exe and it will automatically copy the necessary dll files to this folder. Afterwards you can run your program without issues.
The official documentation for the tool can be found here.
Alternative 1: While developing you could use QtCreator which automatically adds the paths to the dlls when running your program - make sure to include them if you deploy your program!
Alternative 2: Add the path to the necessary dlls to your PATH variable. This isn't recommended either, since everyone who gets your program would have to do the same to run it.
I figured it out! My installation of Anaconda (a Python distribution popular for data science and machine learning) is the culprit.
From: #remy-lebeau
The application was unable to start correctly (0xc000007b)
The error:
"The application was unable to start correctly (0xc000007b) ..."
is a good indicator that the 32-bit app tried to load a 64-bit DLL. At first, this did not make sense since I verified many times that I was using the 32 bit version of Qt.
It turns out that the installation of the 64 bit version of Anaconda also contained many Qt5 dlls used for the PyQt5 package. Since the path to this folder came before the path to my c:\Qt...\bin folder, it was used in the build instead of the actual 32 bit version installed with Qt. This was not obvious because I was unaware of PyQt5 so I had no idea that it came with Anaconda. A simple reordering of the path entries using the System Environment Variables interface AND a system restart fixed the problem.
Silver lining: I now know C++ and designing GUIs w/ QT and PyQt5
Thanks #albertmand and #jwernerny

Qt deployment issue (MinGW inside)

I try to deploy a Qt app on a basic Windows 7 Pro SP1 machine.
My app works fine when I run it inside Qt Creator or on any machine with Qt insllated.
I have read a lot of posts and try many different things without success.
Things tried :
Windeploy Qt
Quick and dirty method of Qt Wiki
Add mingwm10.dll
Add libEGL.dll
Check loaded dll with dependency walker
Check loaded dll with Qt Creator debugger
My app crashes when I run it with these two error messages :
This application failed to start because it could not find or load the Qt platform plugin "windows".
This application has requested the runtime to terminate it in an unsual way. Please contact...
This is my current tree (obtained with windeployqt) :
*.exe
*.dll
platforms/qwindows.dll
imageformats/*.dll
iconengines/*.dll
With dependency walker, I have some red lines even if the app runs normally but nothing interesting.
Dev machine info :
Windows 7 Pro Sp1 64 Bits
Qt Creator 3.3.0
MinGW 4.9.1 32 Bits
Qt SDK 5.4.0
I'm probably doing something wrong but what ?!
The executable seems to search something in the Qt base directory because when I rename it the deployed app doesn't want to work anymore.
Need help please ;)
Ok, I found the solution...
I added this line at the very beginning of my main function :
QApplication::addLibraryPath("./");
After that, windeployqt does the job.
I hope it will help someone in the future.

OpenGL issue with QT5 qml applications on I.MX53-based board

I have DIGI ConnectCore development kit, based on I.MX53 microprocessor, on which iI'm trying to launch QT5 QML-based application. But building rootfs image by means of Yocto doesn't bring good results.
I use Ubuntu (64-bit version 14.04) virtual machine and following meta-layers (both "daisy" and "dizzy" branches I've tried):
Those from Freescale community (Github);
Meta-qt5 layer (Github)
I have already tried fsl-image-multimedia(-full) recipe with modified local.conf, which contents concering QT5 I get from this link.
I have to say, builds was successful, but I haven't managed to launch QT Quick-based applications (those one based on widgets runs well), and I've got following errors from debug console, when I run app under X-window system (by using "-platform xcb" postfix):
Could not find of the system's Compose files. Consider setting the QTCOMPOSE environment setting.
QxbIntegration: cannot create platform opengl context, neither GLX nor EGL enabled
Failed to create openGL context for format qsurfaceformat
... and such errors I've got when run with eglfs plugin (-platform eglfs):
Could not find of the system's Compose files. Consider setting the QTCOMPOSE environment setting.
Could not create the egl surface: error = 0x300b.
I realize that such messages points to OpenGL-related problems, but I cannot understand, what's the reason. GPU-related packages are included in build (I mean "amd-gpu-bin-mx51" and "imx-vpu"). I have tried both X and direct framebuffer (by adding DISTRO_FEATURES_remove = "x11 wayland" in local.conf) variants, but with no success.
Do I need to get some special packages on configs in order to get QML applications working?