Stand-alone app with wxWidgets - c++

I've got a problem with my app, when it comes to executing it in compiled .exe form. I am new in this and I don't know where the problem is. I already tried to search this problem on Google & this site but nothing what I found helped me.
I am using Code::Blocks IDE with MinGW and wxWidgets 2.8.X installed.
Everything works fine inside IDE, but when I try to run it as exe - already compiled - I get an error like this:
The program can not start because the computer is missing wxmsw28u_gcc_custom.dll.
Try to solve this problem by reinstalling the program.
When I copy this .dll file right next to my .exe then it will execute without any errors.
Any clues how to fix it ? I guess it's easy to fix but I really don't know how ...

It needs the DLL file to execute. You can either ship that with your app, or compile wxWidgets as a static library, so that it will be shipped in your .exe file (thus making it bigger).

Related

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!!

OpenCV in Code::Blocks: The application was unable to start correctly (0xc00000be)

I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.

Qt5Cored.dll missing when trying to run application

I'm using Visual Studio 2013 Ultimate.
My Qt version is 5.2.1
Am using a specific build for VS2013 which I obtained from here.
Now, what I did:
Created a new Qt Application from Visual Studio.
Typed in my logic and the code.
Built it successfully in x64 Debug mode.
Ran the application successfully.
Everything good so far.
Now the problem:
I restart my Visual Studio and load the project.
It is built successfully (in x64 Debug).
Now, am unable to run it. I get the error:
The program can't start because Qt5Cored.dll is missing from your computer.
Try reinstalling the program to fix this problem.
It ran the first time when I created the application. Now it won't run.
I tried simulating the problem, and this happens everytime. Runs the first time, and doesn't run after Visual Studio restart.
Please help me resolve this issue.
Thanks in advance.
From project properties you have to go to debugging -> Environment -> and write PATH=qt5 dll paths Or you have to put the dlls next to the exe.
The first time you in debug mode. Probably in that case Qt5Cored.dll (with a d in the name) was used. Maybe in the second build, you build in release mode, and for some reason Qt5Core.dll is not found in the PATH.
here is what i did and it worked :D
first : make sure you are building a release version not a debug version
second : it asked for the qt5core.dll when you copy it to the same path of your program it may ask for other *.dll files so i put the program in the folder containing all the dlls :D
which is
C:\Qt\Qt5.7.0\5.7\mingw53_32\bin
or according to your installation ..it worked well
any way this folder (as i think) contains all DLL libraries you may need with your program
so to know what exactly you need from it try to start your program many times in another location and in every time you will know another dll needed according to your programming ..
that method worked but i think there may be a more cleaver solutions we have to dig for :)

CPP file runs, but doesn't work when compiled to exe

I have created a cpp file using Microsoft Visual Studio 2010 and Allegro. It runs perfectly fine in the Visual Studio interface, but when I compile it into an exe, it says:
"The program can't start because allegro-5.0.10-monolith-md-debug.dll is missing from your computer. Try reinstalling the program to fix this problem."
I am running the exe on the same computer I used to write the code and debug it, so it shouldn't be the fault of a missing dll. Should it? That doesn't make sense to me.... I have compiled other exes before, and they do run on other computers, and the Allegro one works just fine while it's a cpp file, but when the Allegro file is run as an exe, it says I don't have the monolith thing.
Why is the file failing as an exe, but not a cpp?
This is what worked for me:
When in Configuration Properties -> Debugging
- Add PATH=c:\allegro\bin;%PATH% to the Environment Variable.
I had the exact same error, the program was telling me that it couldn't find the monolith DLL file. What I had noticed is instead of PATH=c:\allegro\bin;%PATH% I had put PATH=c:\allegro\bin:%PATH%. The difference is not easy to spot.
I put a : instead of a ; between bin and %PATH%
it was an easy mistake, however it caused me about 3 hours of heartache to fix.

Program only executes if I run it in Visual Studio

I have been trying to find a solution for this problem but I haven't been able to see/find any answer that correctly solves it.
I coded a program (Qt + OpenCV) that works fine when I run it with Visual Studio, but trying to run the executable it simply does not execute anything. The program doesn't give any error: it just never starts.
I am not sure where to start checking what is happening and why it is not even starting (I could understand lack of libraries, some other error..).
I am basically interested on what are the best way of checking why a program runs when executed from the IDE and not from the executable created. As I said, I was expecting an error message if something was wrong. Any ideas? Any good programming advice regarding how to avoid this problem in the future?
Edit: I forgot to mention that I am coding with a Windows XP machine. It doesn't work in this machine when I try to execute the file. It executes normally on a W7 machine but not in other W7 machine.
The executable will need the QT libraries on the computer that you are running it on. On linux there is command (I think ldd) that will show you what libraries your executable needs. I am not sure about Windows but there should be something similar. At least on a linux computer it will not necessarily give you an error if the QT libraries are missing. The executable just seems to do nothing.
Try copying the executable into the same directory as the .dll files in the Qt 'bin' directory.
If that works then you just need to put the Qt bin directory into your path, or copy the dlls into the windows\system directory
You need not only the correct dlls in your path (best in the application directory), but also the plugins in the correct location. See my answer to the question: Qt dll deployment on windows.