Code::Blocks program doesn't run properly when run button is hit - c++

I have been compiling and running programs in C++ on Code::Blocks longly but today one of my programs compiled successfully but when I ran the program it returned -12 with time -0.00s. Whenever I write a new program in C++ the program compiles but it doesn't run. Also when I open the executable file created by Code::Blocks in the same directory Windows takes permission from me to allow the executable file to make changes to the computer. I've been trying through the day but I couldn't figure out what could be going wrong.
Also when I tried uninstalling Code::Blocks it didn't uninstall completely and when I opened the Code::Blocks folder in Program Files and tried deleting the folder the folder MinGW couldn't be deleted because Access was denied.
Please help if you could comprehend the problem and have knowledge regarding the issue.

Related

Can't run .exe file on another computer

I'm trying to figure out why my application will not run on another windows computer. I have tried to run the exe file on multiple other computers where it starts the application up fine, however, when running it on a Teguar running windows 10, the application throws an exception.
It seems like the problem accurs when I try to use Open3D, since when I don't include Open3D the application can run on the computer. However, the program can still run on all other computers with Open3D included just not on the Teguar.
I have tried to run the exe file through "SimpleProgramDebugger" and here I can see what files are called. This is the files from my own computer where the program runs fine.
Here is an image of the files from the Teguar:
And lastly here is the message on I am given when simply running the application:
Hopefully someone can help with this frustrating problem :)

How Can I send .exe files that will still execute on the recipients computer?

I've written and compiled a program in c++ that does replaces an online calculator for a business. How can I send them this file in a way that will allow them to run the program without downloading a compiler?
I have tried sending the file as a .txt and changing it to a .exe, as well as sharing a google drive.
When I run the program from my own laptop desktop it is successful, but throws the following error message on the recipients laptop:
The code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem.
I assume that this is because they do not have the compiler downloaded (I used VSC to write and compile). Is there any way around them downloading VSC and compiling the code themselves?

Stand-alone app with wxWidgets

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).

MinGW compiles the program and creates the .exe, but Eclipse doesn't run it

I have installed MinGW and then ran Eclipse, but something must have gone wrong somewhere.
I have done this process on other machines and from Eclipse I've been able to compile and run the program.
However, on my own machine (figures...!) MinGW does create the .exe when I select "build" from within Eclipse, but then it won't run.
To run programs I've had to go into my project folder, copy all relevant .dlls in there, and running manually...
Needless to say this is a pain and as I'm only learning C++ still, I have a lot of projects and those .dlls copied everywhere are starting to take up a lot of space.
Have I missed anything?
Is there a way to fix this?
I have already tried uninstalling everything and re-downloading both MinGW and Eclipse, but no luck. Any help would be much appreciated!

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.