Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Kat B on December 17, 2018, 06:23:41 am

Title: New compiler can compile CodeBlocks won't execute
Post by: Kat B on December 17, 2018, 06:23:41 am
Codeblocks version: 10.05

Long story short -- I installed a new version of the MinGW compiler in a different folder (hoping to keep the old and new). I copied the default compiler in CodeBlocks (under Settings > Compiler and Debugger) and changed the name of the copy of the compiler and the path in CodeBlocks under Settings > Compiler and Debugger > Toolchain executables.

I can compile! Yay!

Codeblocks doesn't run the executable when going to Build > Run. Changing the compiler back to the previous default, the code compiles AND CodeBlocks can run the executable. I think this means I can rule out the execution path in Project settings.

Anyone have any idea why I can compile and run under one compiler but not the new? Is there a setting I need to change?

Thanks!

Kat
Title: Re: New compiler can compile CodeBlocks won't execute
Post by: gd_on on December 17, 2018, 08:42:38 am
You have also to change your system variable path because it certainly contain the "old" path to your previous compiler and not the new one.
More, give this new path a higher priority (place it before the old one), because Windows will choose the first one : dll names are probably the same !
gd_on
Title: Re: New compiler can compile CodeBlocks won't execute
Post by: Kat B on December 18, 2018, 04:41:33 am
Done but no cigar :-(

Still not able to run the successfully compiled file from within Code::Blocks
Title: Re: New compiler can compile CodeBlocks won't execute
Post by: oBFusCATed on December 18, 2018, 11:50:40 am
1. 10.05 is so old
2. Your compiler new compiler probably compiles executables which require extra dlls to work. Use dependency walker or something similar to fine what is needed. Then the easiest fix is to copy them next to your executable manually.
Title: Re: New compiler can compile CodeBlocks won't execute
Post by: BlueHazzard on December 18, 2018, 02:51:31 pm
Some error messages would also help...
Title: Re: New compiler can compile CodeBlocks won't execute
Post by: Kat B on December 19, 2018, 01:43:13 am
BlueHazzard - there are no error messages. There is only a failure to launch.

Answer!
It turns out that the Compiler's Installer Directory was slightly wrong. I hadn't specified the bin folder (the file dialog didn't give me that option the first time round). I set it to a wrong thing, to reset it to the right thing which then allowed me to point to the bin folder. So now it both compiles AND runs!