User forums > Help
Can't find compiler executable error - not nice
rickg22:
Alright! Thanks Yiannis! :) I guess I'll add it to the "current issues". Please tell us when it's fixed, anyway.
mandrav:
--- Quote from: rickg22 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.
--- End quote ---
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...
roussec:
--- Quote from: mandrav on October 27, 2005, 06:55:29 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 ;)
--- End quote ---
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
rickg22:
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 :) )
takeshimiya:
What about a meta-template format that includes inside different templates for different compilers?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version