Author Topic: Environment error: Can't find compiler executable  (Read 515 times)

Offline Andre_Mikulec

  • Single posting newcomer
  • *
  • Posts: 8
Environment error: Can't find compiler executable
« on: February 17, 2020, 11:52:36 pm »
Hi,

I have developed a VERY customized method to compile/debug/build R language packages that contain C code or Fortran code.  The setup time to create the *VERY customized method* may involve between 30 minutes and two(2) hours of time to setup.

An environment variable helps me find the compiler (that has a dynamically generated location).
Specifically, the compiler location is set by using an environment variable.  Sometimes, when I am transitioning between tasks, I sometimes I will change that environment variable.
Sometimes, I do not set an environment variable correctly. 

Next, just at when I am starting Code::Blocks, either, (1) the default.conf file itself will not be found or (2) the compiler itself will not be found. I get back this  error message:


Quote
Environment error
-----------------

"Can't find compiler executable."

Next, I shut down Code::Blocks.   I put back an environment variable back to its previous and correct setting, and  then I try to start Code::Blocks, I still get the message:


Quote
Environment error
-----------------

"Can't find compiler executable."

I also have read . . .

Quote
Topic: codeblocks crash on startup

One thing you can try is to delete C::B's default.conf in %APPDATA%\codeblocks
(or better rename the folder so you can recreate your conf if it is not the cause).
C::B will create a configuration from scratch at next start (if it starts).

Topic: codeblocks crash on startup
http://forums.codeblocks.org/index.php/topic,12786.msg86461.html#msg86461

My impression is the default.conf file has already been "written to" and
this "written to" has made my previous settings unobtainable (gone).

The case seems that when code::blocks can not find its compiler on startup, it tries (and is successful) to rewrite the default.conf.  While this *feature* is useful to most people (so they can easily recreated their environments),
this feature is not good for me. Next, I would have to spend between 30 minutes and two(2) hours to re-create the setup.

Questions

Quote
1.
How do I go about disabling this "Can't find compiler executable." fix-it feature, if possible.

Quote
2.
Since this "Can't find compiler executable." problem often happens to me,
does anyone have any good backup and recovery strategies involving the default.conf file?

Thank you very much,
Andre
Andre Mikulec
« Last Edit: February 18, 2020, 12:03:49 am by Andre_Mikulec »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6957
    • My Best Post
Re: Environment error: Can't find compiler executable
« Reply #1 on: February 18, 2020, 12:06:19 am »
Have you tried cb_share_config ? It is part of Code::Blocks.

Edit: Code::Blocks should not be running when using it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Andre_Mikulec

  • Single posting newcomer
  • *
  • Posts: 8
Re: Environment error: Can't find compiler executable
« Reply #2 on: February 18, 2020, 12:12:55 pm »
Hi,

I just noticed that in the compiler list dialog, if I quit (press the X in the upper right hand corner),  I will continue into code::blocks (and not have my default.conf manipulated/destroyed).   Now, I have the opportunity to fix my variables and the default.conf. 

About this ignore/skip method, I am not so sure that the "click and ignore" feature is in the documentation. But, it should be.  Note, code::blocks is a great IDE.

Therefore, I seem to not have a problem anymore.

stahta01,
I will try cb_share_config.  Hopefully it will make my life easier.
Thanks.


Offline cacb

  • Regular
  • ***
  • Posts: 426
Re: Environment error: Can't find compiler executable
« Reply #3 on: February 18, 2020, 06:34:00 pm »
It is not clear how you edit the configuration, but if you are using Code::Blocks to do it, in my experience you should always exit C::B afterwards to make sure it is really saved before trying to do anything with it. I think the design is a bit flawed in this area, so I always exit C::B to save my recent changes.

When editing configurations this way, you must not have more than one instance of C::B running, or else you are likely to get the settings overwritten. If you are using another tool, like a text editor or cb_share_config, no C::B instances must be running.

I made my own configuration manipulation tool recently ( see http://forums.codeblocks.org/index.php/topic,23635.msg161051.html#msg161051 ) and in that process I discovered that all text info must be written inside CDATA sections in the XML file. If you miss that, strange things start to happen.