Visual Studio 2013 - Qt5 - Gstreamer: "libgstreamer-0.10-0.dll is missing from you computer" even though I correctly installed Gstreamer - c++

A similiar question was already asked on stackoverflow, yet nobody answered, so I'm asking again.
I followed all steps in http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows
Therefore, I believe that I correctly installed Gstreamer SDK + Devel on my computer. I followed the steps to set the enviromental variable: GSTREAMER_SDK_ROOT_X86_64
On Visual Studio I created a new Qt5 project, I set up the property sheet for gstreamer, yet when I run my application (still a basic Qt app with gst_init called) an error occurs saying:
The program can't start because libstreamer-0.10-0.dll is missing from your computer.
Some say that the dll must be in Windows/System32 or SysWOW64 yet there is no such file there. That dll is by default found in gstreamer_root_sdk_folder/bin.

When you run your app out of your develop environment (directly by clicking .exe generated file) you have to emplace your dlls in the same folder where your app.exe file is, unless you compile it with static libraries.
You have to look for libstreamer-0.10-0.dll in the Gstreamer SDK install folder (gstreamer_root_sdk_folder/bin as you pointed out), then copy and paste it in the same folder where your app.exe file is. Try to run again.
Maybe you will have to add some missing dlls after solve this. You can do it by following the same process for all the missing ones.

Related

Theme and Icons Problem with GTK3 Installed with vcpkg

I am using Visual Studio 2019 on Windows 10 and am trying to use GTK in C++ and installed it using vcpkg.
I've installed GTK using vcpkg according to the guide from GTK. I'm using Visual Studio 2019 and it is able to compile and run the example program here, but there is an issue regarding the theme and icons. According to the installation guide, under the section Building and distributing your application there are some things that must be done to get themes and icons to work.
I've started by downloading the Windows theme the guide suggests and have it in a share directory and then I've created a settings.ini file in an etc directory. It says to place this in the "install directory", which I assume is where Visual Studio is placing the exe for the program. I've tried it in both build and release, in the source files, in the top project directory - all with no success (and I did make sure it is targeting x64).
Just in case I also tried placing these where vcpkg is installed as well as where vcpkg installs gtk. No luck. When the program runs I get the warning
(gtkExample0.exe:16772): Gtk-WARNING **: Could not find the icon 'window-minimize-symbolic-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
So it seems that it is never finding the ssettings.ini file telling it to use the Windows 10 theme. Has anyone had any luck with getting this to work (both from VS2019 debugging runs and in deployment)?
To summarize the files:
share\themes\Windows10\gtk-3.0\gtk-3.20\ (downloaded from suggested GitHub repo)
etc\settings.ini contains:
[Settings]
gtk-theme-name=Windows10
gtk-font-name=Segoe UI 9
I've placed these in
<VS2019Project>\x64\Release,
<VS2019Project>\x64\Debug,
C:<path_to_vcpkg>\vcpkg\packages\gtk_x64-windows,
C:<path_to_vcpkg>\vcpkg\installed\x64-windows
All with no change when running from VS2019 under Release or Debug.
Theme and icons considered as external resources are not distributed by vcpkg, and the instructions given in the distribution guide from GTK regarding where these resources should be layout on windows 10 are not crystal clear. The problem has also been reported here vcpkg issue#4417.
The solution proposed hereunder is to install
all the resources in the <VS2019Project>\x64\Release directory of your VS project where your .exe application lives [This is a local solution the problem. A global approach should consider the setting of some user-defined free desktop environment variables which is not discussed here]. Icons can be picked from an ancillary MSYS2 distribution and the theme as indicated in the GTK Guide. The solution should be replicated for the Debug branch.
Supposing you have MSYS2, install mingw-w64-x86_64-adwaita-icon-theme package with the pacman package manager if not already done on your MSYS2 installation pacman -Syu mingw-w64-x86_64-adwaita-icon-theme.
Copy C:\msys64\mingw64\share\icons to <VS2019Project>\x64\Release\share\icons
you should get both hicolor and Adwaita icons as subdirectories of your target dir.
Copy the theme resources downloaded in the source gtk-3.20 directory directly into <VS2019Project>\x64\Release\share\themes\Windows10\gtk-3.0\. Do not locate these resources into a gtk-3.20 subfolder: to understand why consult this article Theme Location [assuming here that no global desktop environment variable has been set].
Create a <VS2019Project>\x64\Release\etc\gtk-3.0 directory, put your settings.ini into it.
Recompile and you should obtain a windows 10 look and feel for your application window.

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

Debugging Qt in visual studio, msvcp140d_app.dll is missing

I'm new to Qt, but have been working with Visual studio for C/C++ development for a few years. Now I'm trying to build a GUI for my project. I installed Qt 5.11.0 and the Qt VS Tools on both my work computer and home PC. At work I can build and run my project with the VS debugger, however on my home system I can build but can't run either with VS debugger or simply launching the app. I tried in release and it runs fine.
The error I'm getting is :
The code execution cannot proceed because VCRUNTIME140D_APP.dll was not found.
I get 4 of these, the first two want VCRUNTIME, the second two want MSVCP140D_APP.dll.
Solutions I've tried so far :
Uninstalled Win SDK and reinstalled
Uninstalled VS2017 and SDK and reinstalled
Searched System32, SysWOW64 and VS install directories - found msvcp140d.dll and vcruntime140d.dll, but no _app.dlls
Does anyone know what these are included with and where to get them? I can't figure out why I have them on my work computer but not at home. I have the same VS updates, same Qt version, and SDK on both systems.
Using :
Visual Studio 2017 v15.7.1
Qt 5.11.0 - msvc2017_64
I suppose I can just copy the .dll's from my work pc and drop them in the appropriate locations on the other, but I'd like to know what they should have been installed with so I can have the same setup on both systems.
Edit:
I also tried changing the platform toolset to VS2015 with Qt versions msvc2015_64 and winrt_x64_msvc2015
I found this post concerning the same missing _app.dll files. There wasn't any answer there, which is why I tried reinstalling the SDK in the hope the missing files were included there.
Edit 2:
I just scanned my entire system at work and it turns out that I don't have the missing .dll there either. That tells me that there is a difference in the project properties or configuration between the two. I use git for source control, and I am currently the only contributor to this project. When I try to build and run just the example from the getting started guide I have the same problem at home with missing _app.dll files, however it works fine at work. I'm totally confused now, and any hints are greatly appreciated.
Solution:
After trying for a couple of hours making new solutions etc. I decided to delete the entire build folder and put fresh copies of all the dependencies into it. My project now runs fine in debugging mode.
I'm fairly certain that when I originally copied the Qt .dll files into it I must have grabbed them from one of the winrt folders rather than the msvc2017_64 folder. To test I replaced the working .dll files with those from the winrt_x64_msvc2017 folder and sure enough the same errors again. So, this was a dumb mistake on my part, but hopefully it'll save someone else a lot of hair-pulling in the future.

VS 2017 Setup Project wouldn't install in C:\DestFolder\

Due to the administrative privilege of the application, I need to install my program including .exe and .dll in C:\DestFolder\SubFolder\ but I keep getting C:\Program Files\\[Manufacturer]\\[Product Name]\ where the placeholders are specified in the properties window.
I tried this article but no good.
Please don't give me answer like try changing the defaultlocation to C:\Destination\ of the Application Folder as I have already tried. Also I don't want solution like just change the installation destination path manually during the installation.
I have found the answer from this article:
"[ProgramFilesFolder] is built in, and correctly leads to the Program Files directory on the target machine, no matter how customized the setup of Window is..."
There might be tools out there that allow installing outside of Program Files.
[Edit] Infact I've found out this great extension for VS 2017 community called Wix. There's a guy who did a fabulous tutorial on it.

Cannot run Qt C++ release build. 'The procedure entry point could not be located'

I am trying to deploy my Qt application and have run into a fatal error. The program works fine in the Qt editor, I can build and run it. After building my project in release mode and using windeployqt.exe to get the correct .dll's in the folder, I am treated to this error message. I get one for 5 different Qt .dll's. I found a way to remove this error by using the .dll's from Qt tools instead of the ones found in the compiler's bin directory. But, I am left with a remaining error like this. Unlike the previous errors', there is no dll being cited, only my program's directory.
I've tried this with 2 compilers by now. That which is provided by Qt, and my own installation. Both you can tell, have failed.
I had a similar problem few years ago when I was just learning QT. What I tried which did worked is that to move the .exe generated file to the location from where you copy paste the dlls and it worked like charm. You are getting the wrong dlls copied (perhaps). Try searching for correct ones on google!!