Difficulty to correctly run Qt6 executable file - windows

My Qt6 run okay when build&run from the Qt Creator (Debug & release). Today I tried to run the exe file with no sucess. In fact, I first try to copy past dll manually and then using the windowsdeployqt.exe but I'm still getting the same error whatever I do. I only have one compiler minGW and I always take DLL and windowsdeployqt from Qt/6.3.0/minGW/bin.
From my research what I understand is that my .exe is calling the _ZN3... functions in Dlls but the function doesn't exist. However I don't know what to do now. If anyone as a clue ?

Related

"flutter run -d windows --release" works but executable doesn't

I do have a strange behavior with a flutter package I am building. It uses FFI to integrate a custom-made c++ library.
When I run flutter run -d windows --release the code starts and I do have the window with the code running.
However, when I go to the directory where the executable is stored and I run it, the program starts but the library is not loaded. I do see also that when I run flutter test, it complains that it cannot load the library. I have checked that the dll's needed are there using dependenciesGUI.exe and it seems that everything is fine, at least on my side. I do see however that within kernel32.dll I am missing ext-ms-win-oobe-query-l1-1-0.dll.
I am using Visual Studio 2022 with the x64 configuration.
Any idea on what could be the issue? For me it is VERY puzzling to be able to run the software through flutter but not with the executable directly.
Thanks!
Yours,
Pi-r
EDIT:
I compared my package with a fresh package built with flutter. With a fresh package, the behavior is the one expected: I can have the program run normally or with flutter run.
I compared the libraries of the clean package with the ones linked in my package. They are the same (with the same missing dlls which do not seem to pose an issue).
I also checked that the exported functions I needed where present -> It is the case.
The only difference I can see is that using flutter run adds a series of libraries to the path. Has I am a Linux person, I do not know of a tool that could be used to detect what is the missing library. I am open to write a separated c++ code that would load the library if it could help me identify what is the issue... ANY tips/tricks would be greatly appreciated :)
I finally found the issue I had and it is related to a different behavior under Linux and under Windows (as you will guess, I am a Linux person).
When compiled under Linux, I can force the compiler to link multiple libraries relatively to my main library. I discovered that this is not the case under Windows. Either the dlls are in the executable folder or in the Path.
For the sake of code clarity, my package uses two different libraries. Library A, which is compiled from flutter with the ffi package, called library B. First the second library was in the asset folder and with the relative linking of Linux, it was working perfectly. But it did not work under Windows until I explicitly copied the two in the same directory of the executable.
The solution was then to ensure that both libraries are copied correctly in the directory of the flutter executable. This can be done easily if you add the dependent libraries to the bundle variable in the CMakeLists.txt of the package.
However, this doesn't work when you do the testing (flutter test). As the bundle mechanism seems to be not propagated to the test function. Therefore here, the only solution is to copy the dependent libraries to the root directory of the source code :vomiting_face:
I must point out that this is only the case under Windows, for Linux, it works out of the box...

wxwidgets platform.h error: no such file or directory wx/setup.h

I am using Code::Blocks with wxwidgets and I have include and lib folders under Document\wxwidgets. I am very new to c++ libraries. In Code::Blocks project initialization, I entered the location for wxwidgets. Then in setting/global enviornment variables I entered in base the Document\wxwidgets again. Still, I am not able to run the app. It shows the error in the include/wx/platform.h file where it says
C:\Users\Programming coder\Documents\wxwidgets\include\wx\platform.h|148|fatal error: wx/setup.h: No such file or directory|
I am not able to solve this and would appreciate some help. Also I checked and the wx folder does not seem to be there in the location. I don't know if that is normal.
Also, I downloaded the headers(include) from the wxwidgets github repo download page, wxWidgets-3.1.1-headers.7z. Any help appreciated.
Also, I am aware some questions exist already, but their problems are in different because most are using linux. Also I am using Code::Blocks IDE.
You need to build wxWidgets itself before building the applications using it. Its build process will create the setup.h file which is currently missing.
Note that, in principle, you could also use precompiled binaries, but in this case you must use exactly the same compiler as was used for compiling them, i.e. TDM gcc.

MinGW make file compiles but codeblocks will not build

I am trying to convert a C program to VB.NET. (I know, just accept I have my reasons and leave it at that).
Anyway, I wasn't sure if the source code I had was any good so after about a week of pulling my hair out I finally downloaded CodeBlocks, grabbed the MinGW directory and I can make working successful build from a command line using Mingw32-make. Now I want to use codeblocks to build the file because ultimately I want to be able to step through the code however when I try I just get a bunch of errors and no exe. I am not sure what I am doing wrong and just need help. For that matter is there anyway to just have MinGW create some kind of debug info that would be usefull in Visual Studio? I am not a C programmer so sorry if it seems obvious.

Application won't launch from Creator

my Qt application won't launch from Qt Creator, however I can run the .exe directly from the release folder. Why is that ? I am totally lost here. In Qt Creator, I just get a message telling me that my application just crashed, with the code -1073741515.
Qt Creator must be pointing to the wrong dlls. You could reinstall the QtSDK and it should fix finding the runtime dlls in the IDE (Qt Creator).
http://www.daniweb.com/.../ok-so-whats-error-1073741515-again
On this post here they said they fixed it by updating the PATH in Qt. Here is the portion that gets prepended to my PATH variable as seen in the picture below:
C:\QtSDK\mingw\bin;C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib;C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin;
Here is a screenshot showing how to access that:
Another option is you could go into the QtSDK folder, find the bin folder for compiler and platform you are using and put it in the path for your system. Then Qt should be able to run the program just by finding the dlls in the system path.
Possibly the shortest option, but the trickiest would be to go into Qt Creator > Tools > Options > Qt4 and make sure you have something that looks similar to this:
.
Going by this answer it looks as if it's failing to find a shared library.
Check the appropriate path environment variable in the project's run settings and make sure it's got everything it needs.

cudart32_31_9.dll is missing from your computer

I have a visual studio 2010 c++ solution (with cuda and nsight), it builds just fine, but I try to run it, it tells me this:
The program can't start because cudart32_31_9.dll is missing from your computer. Try reinstalling the program to fix this problem.
I've looked and I have cudart32_31_9.dll and cudart.lib on my computer and in my linker options, I've set the Additional Dependencies with the link to my cudart.lib (which is suppose to be "linked" with the dll in question).
I've looked a on Google, but the only things I found seems to be related to a program called "Folding"... which isn't quite my problem.
Any hint would be appeciated :)
I'm assuming it's a "typo", but there is no point in linking against a DLL. To solve your main problem however, make sure that cudart32_31_9.dll is either in the directory of your executable, or that its directory is part of the PATH environment variable.

Resources