QT Release version not showing video - c++

I am trying to deploy my windows GUI application. I ran the executable through DependecyWalker and added all the missing DLL files, so the program starts up. I had troubles with images not saving to file after downloading. but after I added the "plugins\imageformats" folder to my program folder everything with images is working like a charm. My problem is now that DependecyWalker does not report any missing DLLs, but my app does not show the video. The QVideoWidget is just white. It works fine on my development computer through QT Creator, but no success when testing the release on my virtual machine.
Does anyone know which folders and/or dlls I am missing for videos to show up? I used the windeployqt tool. Thanks in advance.

You need to copy folders plugins\mediaservice and plugins\playlistformats to your app folder. Then it should work. You can add this line to the .pro
CONFIG += console
to see what wrong when running in vm. At last, I would recommend using vlc-qt, with which you can deploy on XP easily.

Related

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

Application Qt and Qwt won't run from menu

Greetings for the first time:
Usually I can work my way through problems like this but I think I need help for this one.
I have developed a small utility for myself to plot some data using Qt and Qwt under Mint. When I run the application from Qt Creator everything works fine. Once I added (export LD_LIBRARY_PATH="/usr/local/qwt-6.1.3/lib") to my .bashrc file, I can invoke the application from the terminal with “./PlotAccountsChange” and it woks. Also the ldd command shows all dependencies have been found.
The problem I am having is that the application can not be invoked from the Nemo file manager, or from the menu system if I add the link to the executable in the menu, or from a link to the executable placed on the desktop. In all of these cases I get no indication at all, just nothing happens. Any other application that I have created using Qt but that doesn’t use Qwt invokes without problems.
Thank you, regards,
B Kace

Qt5 Deployed QtWebEngine Project Not Playing Html5 Videos

I'm am unable to play Html5 videos on a deployed Qt5.4 QtWebEngine project. I used the Fancy Browser example and built it with MSVC2013 OpenGL 64bit, and deployed it using windeployqt.exe. Now this right here will work fine but the app won't run on a computer without Qt5.4. So to fix this, I create a file in the exe directory called qt.conf and inside it I put:
[Path]
Prefix=.
This will fix the app and allow it to run on other computers without Qt. But then the problem now is that after adding the qt.conf file, it can no longer play Html5 videos. Is there a plugin or DLL I'm missing? I've been looking and messing around but can't find it...
Ok I ended up finding it. windeployqt didn't copy the ffmpegsumo.dll in the qtwebengine folder inside the plugins directory. But there's one thing with doing that... when you put it there, the app needs the MSVC Debug DLLs to run, which isn't really a problem, just an inconvenience.
Qt 5.5.1 msvc2013 I copy the ffmpegsumo.dll to run directory ,it also can't work

Deploying Qt Qml App to Windows shows me a blank window

After suffer with a lot of problems trying to deploy a Qt/Qml app to Windows 8, as I described in this question: Deploying Qt Qml app to Windows 8 shows me a blank window
I could make it work copying the Qt5Widgets.dll... but it was only working in my own development machine (installing it there, but yet my own machine).
Then I tried to install it in another machine (a VM running Windows 7).. and at first I got error of missing platform plugin... ok, I copied qwindows.dll to appDir/platforms, and it seems to resolved this problem.
But then I got another missing dlls errors (the ones related to VS2010), then I installed the Visual Studio 2010 redistributable package... ok, now the app starts, but with a blank window :(
The qml files and everything are in a resources file, so it should be in the binary.
And I've no idea where to go from there to find this issue.
Any idea what can I do? The weird thing is that it was installed fine in my own development machine.
And my conclusion is that deployment of Qt in OS X is much easier.
I've solved the problem with these steps:
check your qml files path. For example default generated code is the following:
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/test/main.qml"));
So qmls should be in "qml/test" folder
check the missing dlls:
download VmMap tool from Windows Sysinternals suite (http://technet.microsoft.com/en-us/sysinternals/dd535533)
compile and run your app in qt creator to get it working like it should
run VmMap and open your running app's process.
sort the lower window by 'Details' - so you'll see all loaded DLLs sorted by path.
copy the missing dlls. It should work now!
I've had also a lot of trouble deploying Qml apps with a blank window too.
In general this site gives useful hints:
https://qt-project.org/doc/qt-5.1/qtdoc/deployment-windows.html
The blank window issue was caused be two different things in my case:
The relative path to the qml files were not correct. I've solved this by storing the qml files in a resource file and then calling them from there.
It seems to be a problem if the application is located on a network drive. I haven't found a solution for that except copying the application to a local folder.
In general I think deploying is a big big pain :-/

Qt Deployment - QGraphicsView not displaying on other machines

So I've been making a program for my company using Qt 4.8.4 (required). When deploying the project to a different machine, the program runs fine (I included Qtgui4.dll and Qtcore4.dll). However, when trying to view a print preview image using QGraphicsView, no other machine will show it. I even tried installing Qt 4.8.4 on the other machine and building it there to no avail. I use MSVC to compile and have installed Visual Studio on the new machine as well. I also include the imageformats folder when deploying the .exe to other machines.
I am at a loss here. I've researched this for days. I don't understand why it runs perfectly fine on my machine but will not run on others even when I replicate the development environment.
I have attached a picture of it actually working.
On all other machines, the preview image shows blank/white. However, I noticed that the image is built and that it will print. It just will not preview.
I know I haven't included any code but I won't be able to include much as it's for my company. But I have included what I could related to the QGraphicsView.
// Create a handle for the graphics view; fix bug where preview would disappear
// on first view; winId() creates the winId; Needed to initialize first
ui->graphicsView->winId();
/************************************/
if (preview)
preview(ui->graphicsView->winId(), &err);
No solution was found on my end. I finished the application with the stipulation that the OS could not be XP.