News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

New compiler can compile CodeBlocks won't execute

Started by Kat B, December 17, 2018, 06:23:41 AM

Previous topic - Next topic

Kat B

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

gd_on

#1
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
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Kat B

Done but no cigar :-(

Still not able to run the successfully compiled file from within Code::Blocks

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard


Kat B

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!