Author Topic: Can't find compiler executable error - not nice  (Read 13945 times)

Offline roussec

  • Multiple posting newcomer
  • *
  • Posts: 27
    • http://
Can't find compiler executable error - not nice
« on: October 26, 2005, 10:59:19 am »
Hi,

when I install RC2 it recognizes that VC Toolkit 2003 is installed and I press Set as default and on Ok. After creating a project and trying to compile I get the error'Can't find compiler executable in your search path for GNU GCC Compiler'. The default compiler is VC Toolkit 2003 but I have to manually go to Project->Properties->Target->Target's build options... and change the compiler from GNU GCC to VC Toolkit 2003. Is there a reason the default compiler is not used for new projects?

Christian

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Can't find compiler executable error - not nice
« Reply #1 on: October 26, 2005, 05:21:17 pm »
Can anyone else confirm this?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Can't find compiler executable error - not nice
« Reply #2 on: October 26, 2005, 06:44:48 pm »
Hello,

I have the same problem (or quite). I have installed CB RC2 and when starting it the default compiler was VC Toolkit 2003. Then I have created a new console project by using the template, but when compiling I have remarked that CB was using:

GNU GCC Compiler (called directly)

In the project properties, the compiler selected and default is the GNU GCC, but under Settings, the selected and default compiler is the VC Toolkit 2003.

Strange. Is this a possible bug?

Despite this "bug" (?), CB RC2 seems to work better that the previous version (but I am using it since 20 minutes). For example by loading several projects of a workspace. The only thing that requires a bit of patient is when you close more than one project to wait until CB has saved the code completion cache of each project.

Best wishes,
Michael

PS.: I have both compilers installed in my computer

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Can't find compiler executable error - not nice
« Reply #3 on: October 26, 2005, 06:53:08 pm »
Try creating a new project but without templates. What compiler is listed as the project's default?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Can't find compiler executable error - not nice
« Reply #4 on: October 26, 2005, 07:05:14 pm »
Hallo,

I have tried to create an empty project without using the template and now the compiler used is the VC Toolkit 2003. But, I have to say that I have changed manually the compiler for the previous project (template generated one). Consequently, I have re-created another project by using the template and the compiler used was again the GNU GCC. In the project build options the selected and default compiler was the GNU GCC.

May be the problem is with the template used for the new project generation.

Best wishes,
Michael

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Can't find compiler executable error - not nice
« Reply #5 on: October 26, 2005, 07:57:01 pm »
Yes, that was my assumption. But please create new project from scratch using the "Project" menu, and save it. Which compiler is listed in the project's options?

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Can't find compiler executable error - not nice
« Reply #6 on: October 27, 2005, 10:11:19 am »
Hello,

In the project's Build Options, in the "Selected compiler" box, the GNU GCC Compiler is chosen. Anyway, I can change it to any other compiler, even if I do not  have it installed, e.g., SDCC, Borland C++ Compiler 5.5.

Moreever, the new project option, just create a default configuration and not a debug and release one (as in Visual Studio). But I am not sure that this is an error.

Best wishes,
Michael

Offline roussec

  • Multiple posting newcomer
  • *
  • Posts: 27
    • http://
Re: Can't find compiler executable error - not nice
« Reply #7 on: October 27, 2005, 11:57:35 am »
Yes, that was my assumption. But please create new project from scratch using the "Project" menu, and save it. Which compiler is listed in the project's options?

If I do that the default compiler is used for the project.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Can't find compiler executable error - not nice
« Reply #8 on: October 27, 2005, 12:12:26 pm »
Hello,

Not really.

If I create a "new project", the selected compiler is GNU GCC which is not the default compiler.
If I create a "new empty project", then the selected compiler is the default compiler (i.e., VC Toolkit 2003).

Best wishes,
Michael

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Can't find compiler executable error - not nice
« Reply #9 on: October 27, 2005, 02:01:09 pm »
Please, don't waste your time on this bug. I know exactly what causes it and it 'll be fixed.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Can't find compiler executable error - not nice
« Reply #10 on: October 27, 2005, 06:22:48 pm »
Alright! Thanks Yiannis! :) I guess I'll add it to the "current issues". Please tell us when it's fixed, anyway.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Can't find compiler executable error - not nice
« Reply #11 on: October 27, 2005, 06:55:29 pm »
Alright! Thanks Yiannis! :) I guess I'll add it to the "current issues". Please tell us when it's fixed, anyway.

I might as well state the problem here.

The problem has to do with templates (obviously :P). There's a piece of code in C::B that, when a project is created from a template, sets the default compiler to be the new project's compiler. This piece of code is commented-out for RC2 (and quite some time for CVS).
So, this is the reason for the behaviour stated in this topic.

Now, you may ask why I did that.
Well, the current template format is a little restrictive for this matter.

Some templates (like console app, win app, dll, etc), have nothing compiler-specific in their options. For them, the compiler could be set on project creation.

Some other templates though (like wxWidgets, Ogre, Irrlicht) have different configs for different compilers. This can be seen in the "Project options" field of the "New project" wizard, as they have different entries for GCC and MSVC (under windows anyway). For these templates it would be bad to set the compiler after creation.

Say you have GCC as default compiler. And you create a new Ogre project for MSVC (which you have installed). Now, how nice it would be if you pressed "Build" and a whole lot of errors appeared and after searching around you discovered that the compiler was (automatically) set to GCC? You would bitch against Code::Blocks and that would be fair enough ;)

See the dilema?
Maybe a flag in the template specification allowing (automatic) compiler change after project creation, would do the trick?

Your views on the subject please...
« Last Edit: October 27, 2005, 06:57:19 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline roussec

  • Multiple posting newcomer
  • *
  • Posts: 27
    • http://
Re: Can't find compiler executable error - not nice
« Reply #12 on: October 27, 2005, 07:14:56 pm »
Say you have GCC as default compiler. And you create a new Ogre project for MSVC (which you have installed). Now, how nice it would be if you pressed "Build" and a whole lot of errors appeared and after searching around you discovered that the compiler was (automatically) set to GCC? You would bitch against Code::Blocks and that would be fair enough ;)

If you leave it the way it is people will also bitch against Code::Blocks since it behaves as you describe it -> Code::Blocks chooses the wrong compiler and can't compile. Since I am not really into the templates and how they communicate with the program I do not know if this is possible. But why not use the default compiler by default and let the templates switch compilers for th eproject if they rely on a different compliler (and generate a warning that a necessary compiler is not installed if it is not installed)

Christian

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Can't find compiler executable error - not nice
« Reply #13 on: October 27, 2005, 07:27:07 pm »
I think a quick "hack" (or fix? ;-) ) would be to specify whether the Template is compiler-specific or not. If it's compiler-specific, have the template specify a particular compiler.

On creating new project from template, if the template is compiler specific, check if the default compiler is the same than the template's.

Here we have 3 cases:

a) Default compiler is template's compiler. Don't ask anything.

b) Default compiler is not template's compiler, but template's compiler is installed. Issue a minor warning. "Note: This project is GCC-specific, so it'll be compiled with GCC instead of (default compiler)". (OK)

c) Default compiler is not template's compiler, AND template's compiler is NOT installed. Issue warning and ask for option. "Warning: This project is GCC-specific, but you don't have GCC installed. Do you wish to set the new project to use (Default compiler), and fix the compiler errors by yourself?"

In any case, add to the template, the compiler used. "OGRE template (for use with GCC compiler)".

(Now I realize the need to specify diff. options for diff. compilers in a project :P - I'm glad version 1.0 is not far from now :) )
« Last Edit: October 27, 2005, 07:29:19 pm by rickg22 »

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Can't find compiler executable error - not nice
« Reply #14 on: October 27, 2005, 07:31:08 pm »
What about a meta-template format that includes inside different templates for different compilers?