Author Topic: New compiler can compile CodeBlocks won't execute  (Read 1046 times)

Offline Kat B

  • Multiple posting newcomer
  • *
  • Posts: 11
New compiler can compile CodeBlocks won't execute
« 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

Offline gd_on

  • Regular
  • ***
  • Posts: 467
Re: New compiler can compile CodeBlocks won't execute
« Reply #1 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
« Last Edit: December 17, 2018, 08:56:08 am by gd_on »
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 3.1.2, Compilers 8.1.0, 32 bits (sjlj, posix : gcc and gfortran installed in C:\MinGW32) or 64 bits by Compilers 8.1.0 (seh, posix : in C:\MinGW64).

Offline Kat B

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: New compiler can compile CodeBlocks won't execute
« Reply #2 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: New compiler can compile CodeBlocks won't execute
« Reply #3 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.
(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!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2432
Re: New compiler can compile CodeBlocks won't execute
« Reply #4 on: December 18, 2018, 02:51:31 pm »
Some error messages would also help...

Offline Kat B

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: New compiler can compile CodeBlocks won't execute
« Reply #5 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!