Qt5 Applications crashing at startup - qt

I have installed Qt 5.0.1 - 32-bit Version on Ubuntu 12.04. All the programs crash at startup with the following messages :
The program has unexpectedly finished.
/home/manager/Qt5.0.1/5.0.1/gcc/examples/opengl/2dpainting-build-Desktop_Qt_5_0_1_GCC_32bit-Debug/2dpainting
exited with code 0
I tried:
Making the default Qml Application
Running a few example applications.
I switched between the debug and release modes as well, but all crashed with similar message. Surprisingly 'Animated Tiles example' works fine. Any suggestions ?
Edit:
In debug mode this is what i get:
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'

I have same problem on Windows with Qt5. As i understood, in qt5 window subsystem moved into plugins and when application start, QApplication object can't find this libraries.
On windows I step-trace my app into Qt code, and find that plugins try to load from folder ./plugins/system where . is folder with our app binary. Also it was a problem with
dependence. Windows specific plugin dependence from libGLES.dll or libGLES2.dll. But GL libs must place in the same folder as app binary, not with plugins.
Correct file tree on Windows look like this
plugins
system
platform.dll
windows.dll
libGLES.dll
MyApp.exe
Try to look in this way.

Firstly check your graphics driver is installed.
Qt5 or higher version supports OpenGL 3.0 or higher, if your system is old one, i think you need to check the graphics card can support OPENGL verion as i mentioned above.
If above things are fine, then i think you need to install some opengl libraries that can be easily downloadable from Ubuntu.
Regards
Ansif

Related

Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)

I have installed Shadowsocks-Qt5 within the code sudo apt-get install shadowsocks-qt5 in terminal, and then I can find the launch icon by searching, but it won't open when I click the icon. Then I tried to use terminal to open it, but the error comes out as below:
~ ss-qt5
Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)
[1] 8875 abort (core dumped) ss-qt5
I searched many answers but no one work. I think the key may be the default Qt library, but I don't know how to set default Qt library, the system on my computer is Ubuntu 14.04 LTS.
How to solve this problem?
I just had this error when attempting to run Qt Creator after doing a system update. For me, I was attempting to run Qt Creator 4.10.0-rc1 (based on Qt 5.13.1) that I had manually installed to ~/Qt along with Qt 5.13.0, and my system has Qt 5.12.2 installed.
I was getting the following error:
Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50d00)
Doing an strace when running qtcreator.sh revealed that it was attempting to load plugins from the system directory. I finally discovered the culprit was the environment variable QT_PLUGIN_PATH was set (in my case to /usr/lib64/qt5/plugins:/usr/lib64/qt5/plugins/kcms).
After unsetting this variable, Qt Creator started up and worked.
After so many months of trying to fix this issue, this helped me.
sudo apt install qt5-style-plugins.
I was facing a similar issue, and even after 4 hours of debugging, I got nowhere. Finally, I found the following way to keep separate Qt versions, posting here so that other people find it.
Suppose you installed Qt in ${QtRoot}, extend the PATH and LD_LIBRARY_PATH:
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
You can make a wrapper function / script to manage separate Qt installations like this:
QtVersion=5.12.8
QtRoot="/scratch/Qt/${QtVersion}/gcc_64"
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
After running this your application will likely run fine.

QT exe file doesn't appear to run

I wrote a program in Qt:
Qt Creator 3.5.1 (opensource)
based on Qt 5.5.1 (MSVC 2013, 32 bit)
Windows 8.1 64-bit
My program is running fine in Qt creator.But I want to execute it in other computers on all Windows without installing Qt. I copied all required .dll files next to the .exe file (Release build) with windeployqt.exe.
When I start the.exe, nothing happens.
No GUI showing up, no error that a .dll is missing. But I see my application in 'ProcessExplorer'.
This happen for even very simple program.
Here's a screenshot of my Dependency Walker screen for simple application:
I had exactly the same problem and as you, I had no error message or any output whatsoever. I solved the issue when I added the QML path to my deployment.
On this page, windeployqt, you will see the commmand:
windeployqt --qmldir < path-to-app-qml-files> < path-to-app-binary>
Here the command with the qml flag.
C:\Qt\5.10.1\mingw53_32\bin\windeployqt.exe --qmldir C:\My_project C:\My_project\build-My_project_MinGW_32bit-Debug
It seems you are using QML.
did you have a look at stdout / stderr? I have had that problem when my QML file was not loadable / path was incorrect.
Also settings environment variable QML_IMPORT_TRACE=1 helped me to spot these kind of problems.

Cant Run Application Created With QT5 And VS2013 In Windows XP

I have application created with QT5 and Visual Studio 2013. I also use QT WebEngine in my application.
My application works fine in windows 7 (32 bit) . For some reason i need to run it in windows xp sp3 (32 bit).
When i run it, I get the following error:
The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll
I press OK several time and it goes away and my QMainWindow will pop out, But its totally BLACK and i see the following errors in debugger.
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available
The d3dcompiler_47.dll is in application directory too.
Whats wrong here?
UPDATE 1
I placed 3dcompiler_46.dll in executable's directory and this is what happened.
I still get The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll error but after i press Ok, I get the following error as well.
The procedure entry point _except_handler4_common could not be located in the dynamic link library msvcrt.dll
The QMainWindow is still BLACK and the errors about ANGLE is the same.
UPDATE 2
I build QT for Windows XP with following configuration
configure -release -opensource -opengl desktop -target xp -platform win32-msvc2013 -angle -icu -nomake examples -prefix C:\QT-Compile
I replaced QT dependency and ran my application, I got the following errors:
The application has failed to start because icuin56.dll was not found
The application has failed to start because icuuc56.dll was not found
I tried to find them in QT directory (C:\QT-Compile) and i couldn't but i had them on main machine that run in Windows Seven, I placed them next to executable and application run successfully and previous errors are gone, However, The QMainWindow is still BLACK and i have the following errors in my debugger in run time.
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
bool __thiscall QOpenGLTextureBlitter::create(void) Could not link shader program:
Whats wrong now ?
UPDATE 3
This is how i configured QT.
configure -release -opensource -opengl dynamic -target xp -platform win32-msvc2013 -icu -nomake examples -prefix C:\QT-Compile
I used windeployqt.exe and placed required DLLs and ... next to executable.
Ran application in windows xp and i keep getting following errors then application crash.
Message Box :
The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll
QT Debugger :
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available
Failed to load opengl32sw.dll (The specified module could not be found.)
class QOpenGLStaticContext *__cdecl QOpenGLStaticContext::create(bool): Failed to load and resolve WGL/OpenGL functions
The first error about msvcrt.dll is about not including visual studio runtime dlls with your binary file. It seems that on win XP machine these libs are different then the ones your app is linked against
The next two errors are about failing to start up ANGLE probably due to mismatch of MS VS runtimes that you have encountered previously.
Basically, just put msvcr110.dll and msvcp110.dll in your folder (or provide means to install MS VS Redistributable for 2013 Studio)
Here is detailed deployment doc from digia - http://doc.qt.io/qt-5/windows-deployment.html
Also i would advice you to use qt's tool windeployqt.exe as a part of deploy process.
Usage is simple - windeployqt.exe path/to/your/binary/file.exe
It will copy almost everything you app needs to run your app everywhere without bothering you to include some plugins and dlls etc (though it will not copy mentioned above MSVS runtime dlls)
Also if you are interested a post about using different opengl for qt5 built dynamically loading of graphical drivers ( tries to use default opengl -> is fails tries to use ANGLE -> if fails, tries to use opengl software (libmesa) ) - http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
It's a bit more complicated then in Qt4, but when you finally handle it properly, it will be more fail safe even on machines with no graphical drivers or no direct X support or launched through VPN
UPDATE
It seems that both desktop opengl and ANGLE fails for you (which would mean, that you have OpenGL implementation version less then 3.0 (default on win xp has 2.0) for desktop opengl to fail and you don't have DirectX 11 or DirectX 9 correct drivers installed (for ANGLE to fail).
This would mean that this is either virtual machine or window without any drivers. To fix this issue, please include opengl32sw.dll (libmesa) to you executable file as well. This is another fallback in case both desktop and ANGLE failed.
You can take in from the folder where your QtCreator installed in folder /tools. Or download it here - http://download.qt.io/development_releases/prebuilt/llvmpipe/windows/
depending on your arch.
Also, try to put d3dcompiler_46.dll from your win xp next to your executable. This might fix runtime error and will allow to launch ANGLE - https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-44985
Update 2:
Let's get it line by line.
You've got The procedure entry point strnlen could not be located in the dynamic link library msvcrt.dll warning because of either you have win XP with not SP3 but SP2 (microsoft dropped support for win XP SP2 for MSVS 2013) - more details here where there is the same issue. Or there is the same bug here that would basically advice to use opengl software.
Now, the errors you see in log:
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): Could not initialize EGL display: error 0x3001 - this is failure of OpenGL desktop, since you don't have Open GL 2.0 -> proper graphical driver.
class QWindowsEGLStaticContext *__cdecl QWindowsEGLStaticContext::create(class QFlags<enum QWindowsOpenGLTester::Renderer>): When using ANGLE, check if d3dcompiler_4x.dll is available - ANGLE is failed. Because either - qt uses mvcrt.dll for MSVS 2013 that does not support your Win XP SP2 anymore or you don't have d3dcompiler. Perhaps it will work with Qt 5.4 built with MSVS 2008 or MSVS 2012.
Failed to load opengl32sw.dll (The specified module could not be found.)
class QOpenGLStaticContext *__cdecl QOpenGLStaticContext::create(bool): Failed to load and resolve WGL/OpenGL functions - These errors relates to missing opengl32sw.dll file. Which i've already provided link for you to download and put to executable.
And app crashes because Qt was not able to run any of OpenGl modes at all. So basically all you can do is force app to use OpenGL software (i provided link for you how to do this numerous times, please read those guide.) or use qt 5.4 and try to run angle. OpenGL software may not run smoothly and have some problems with complex graphical interfaces but this is basically the only thing that is left.
We met the same problem in win 7, solved by install the graphics card driver
I have found another solution as a side option to switch from opengl to software rasterizer and remove these messages:
Could not initialize EGL display: error 0x3001
When using ANGLE, check if d3dcompiler_4x.dll is available
Because in mine case it was the VirtualBox environment which currently having problems with the OpenGL/DirectX (https://forums.virtualbox.org/viewtopic.php?t=82614&start=15#p408392) implementation, then i have tried to search for a solution and somehow workaround the render.
The QT itself have has an option to switch or disable several builtin options w/o need to rebuild anything. Such as is described here:
https://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
It is possible to provide a JSON-format configuration file specifying which OpenGL implementation to use depending on the graphics card and driver version. The location is given by the environment variable QT_OPENGL_BUGLIST. Relative paths are resolved using QLibraryInfo::SettingsPath or QStandardPaths::ConfigLocation. The file utilizes the format of the driver bug list used in The Chromium Projects. It consists of a list of entries each of which specifies a set of conditions and a list of feature keywords. Typically, device id and vendor id are used to match a specific graphics card. They can be found in the output of the qtdiag or dxdiag tool.
The qtdiag tool is stored basically near the qmake executable. You can additionally run it to diagnose the end system on other errors.
For the VirtualBox you can try this:
{
"entries": [
{
"id": 1,
"description": "Software OpenGL rasterizer (opengl32sw.dll)",
"os": {
"type": "win"
},
"vendor_id": "0x80EE",
"device_id": ["0xBEEF"],
"driver_version": {
"op": "<=",
"value": "5.1.38.22592"
},
"features": [
"disable_desktopgl", "disable_angle"
]
}
]
}
, Where:
disable_desktopgl, disable_angle - When no accelerated path is desired. This ensures that the only option Qt tries is the sofware rasterizer (opengl32sw.dll). Can be useful in virtual machines and applications that are deployed on a wide range of old systems.
the 5.1.38.22592 is a version of the VirtualBox.
This is might be not what you search for, but i didn't found it in time for myself.

Cannot cmake kde-connect

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.

Qt 4.8.3 installation on Windows 7 & QtWebkit problems

I just updated my Qt to 4.8.3, because the program built from older version is not compatible to the new framework.
So I have to upgrade.
This process was frustrating and time consuming. So many problems came out.
I download Qt from this url:
http://qt-project.org/downloads
At beginning, I installed the MinGW one (I'm not a fan of MSVC).
I tried the newest ( I think it's 4.6) version of MinGW and order version (4.4).
However, after I installed MinGW and tried to install Qt 4.8.3, during the process, the following message shows up:
There is a problem with your MinGW installation:
The installer could not find a valid C:\MinGW\include\w32api.h (Only versions with W32API 3.13 are supported)
Do you still want to continue? (Your installation may not work)
The 4.6 version does have this w32api.h file, I don't know what's going on. And I have trouble finding MinGW 4.4 with this head file.
I decide to ignore this warning and continue to install Qt and Qt creator. After that,
I opened my current project, configure it (why the configuration become so complex...), I tried to build it.
Then the following message shows up because some external lib I used requires Exception Handling:
exception handling disabled, use -fexceptions to enable
And I don't know how to enable the it.
I tried to add -fexceptions flag in QMAKE_CXXFLAGS but it doesn't work.
By the way, I tried the VC version of Qt too, but I used the MinGW before and the VC compiler is quite different, if I use VC version, it will take a lot of time to make it compilable by VC compiler.
Does anyone know how to install Qt 4.8.3 on Windows? my project works fine before, now I just want to compile it successfully.......
These are not the only problem.
I updated the Qt on Mac machine too, it is easier to have the compiler work since it's unix base.
However, I used QtWebkit lib in my project and obviously, they changed this lib and it's not compatible to order version.
I can compile my project on Mac, however, every time I run it, following massage shows up and the program stopped.
dyld: Symbol not found: _OBJC_CLASS_$_CALayerHost Referenced from:
/Library/Frameworks/QtWebKit.framework/Versions/4/QtWebKit Expected
in:
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
The program has unexpectedly finished.
Does any one know how to solve this QtWebKit problem? I'll really appreciate.
I remembered that when Qt is under nokia, it's so easy to install and use, the Qt SDK is perfect.
I really hate the change made after it was bought by digia.........
I found solutions of my first two problems:
for the first problem, as I described, download the MinGW provided by Nokia Qt
ftp.qt.nokia.com/misc/MinGW-gcc440_1.zip [ftp.qt.nokia.com]
Tried several versions of MinGW 4.4, I think this is the only one works.
About the second problem, add following configure in the project file:
CONFIG += exceptions
Now the QWebKit problem is only one unsolved.
Is it all relevant that your include directory for MinGW has two "i's" in it or was that a typographic error when posted on SO? See:
The installer could not find a valid C:\MinGW\iinclude\w32api.h

Resources