Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: darkonaito_ on June 16, 2020, 05:05:00 pm

Title: Can't execute my own .exe
Post by: darkonaito_ on June 16, 2020, 05:05:00 pm
When I compile a c++ program, I can run it inside CodeBlocks, but when i try to execute it by starting the .exe in the bin subfolder of the project, it doesn't work:

Before, Windows would tell me that 3 .dll file were missing, and after I downloaded them and copied them into system32, when I attempt to run the program Windows gives me error 0xc000007b.
Title: Re: Can't execute my own .exe
Post by: stahta01 on June 16, 2020, 05:10:27 pm
When I compile a c++ program, I can run it inside CodeBlocks, but when i try to execute it by starting the .exe in the bin subfolder of the project, it doesn't work:

Before, it would tell me that 3 .dll file were missing, and after i downloaded them and copied them into system32, when I attempt to run the program, windows gives me error 0xc000007b

Unless you are an Windows expert you should never copy DLLs by hand into the system32 folder!!!

Randomly downloading DLLs is a way to get your computer infected!!!

You should find the DLLs that are missing on your computer under the Compiler installation in most cases.
Copy those DLLs to where the exe is located or copy them to a non-system folder that is in the PATH.

Tim S.

Title: Re: Can't execute my own .exe
Post by: darkonaito_ on June 16, 2020, 05:14:18 pm
Also, it's the first time I have this problem..

I'm not using any strange library or stuff like that, so...

Also, I get that error if i try to run my .exe on any computer.
Title: Re: Can't execute my own .exe
Post by: Pecan on June 16, 2020, 07:10:01 pm
Reasons for Windows error code 0xc000007b
The error code means an invalid image format.

You may be attempting to start an application which is designed to run on 64-bit operating system, but your computer is running 32-bit Windows.

Or you may have clobbered a system dll.

From an administrative mode command prompt (cmd.exe) run "sfc /scannow" to validate your system. It will try to fix clobbered system files. Be patient, this will take a lot of time.

Google search is your friend; and a programmers buddy.
 
Title: Re: Can't execute my own .exe
Post by: oBFusCATed on June 16, 2020, 07:33:00 pm
Also, it's the first time I have this problem..

I'm not using any strange library or stuff like that, so...

Also, I get that error if i try to run my .exe on any computer.
Inspect the lib folder of your compiler for the missing dlls. When you find them copy them next to the executable. C::B modifies the PATH variable for you, and so "hides" problems like these. Another option is to find a compiler which provides static runtime and so you can build a standalone executable. If you need to know more please read about DLLs in MSDN it has plenty of info.