User forums > Help

Different compilers per target in the same project

<< < (3/5) > >>

fabrizio.benedetti:
 :( :( :( :(

I deleted default.conf and let C::B re-create it. I didn't perform a clean install, but the crash also occurs when running the last build in the debugger, the only things in common being in the user folder

C:\Documents and settings\Dati applicazioni\<username>.<DOMAIN>\codeblocks

It's in italian, and I am in a domain so I have .<DOMAIN> appended to the username, but I hardly see how this can cause the bug which forces me to select the compiler at the proejct level or crash. In the user folder, the files I find are:

default.conf
cbKeyBinder10.ini
cbKeyBinder10.ini.bak

share\codeblocks\Plugins and share\codeblocks\scripts subfolders are empty. Another non-standard configuration is the MinGW installation path, which is in C:\Programmi\MinGW instead of the default C:\MinGW (I have to point C::B manually to this folder, auto-detect won't work). MSVC is in a path with spaces, but it is the default one (C:\Programmi\Microsoft Visual Studio 8, with no quotes...) and is auto-detected - and working, when MSVC is selected at project level!

You can have a look at the attached default.conf file, which is the one C::B re-created after I removed the previous one.

[attachment deleted by admin]

fabrizio.benedetti:
 :mrgreen: :idea: :mrgreen: :idea: :mrgreen: :idea:

I found the cause of the bug: in my tests, I was always using the "Build file" command, instead of building the whole project. The latter works perfectly, but when building a single file C::B doesn't select the current buildtarget's compiler! CompilerGCC::SwitchCompiler() gets (indirectly) invoked by CompilerGCC::Build() and CompilerGCC::Rebuild(), but not by CompilerGCC::CompileFile(). So, if I have not yet built the whole project using another compiler than the one selected globally in the project (which happens to be initialized by the CodeCompletion plug-in on opening the Workspace), CompileFile() fails because the compiler it has to use has not been initialized yet. I even found that whien compiling a single file, Init() is invoked on one compiler, and GenerateCommandLine() on another.

killerbot:
good to know you found the same working way as we do :-)

Please file the bug on the single file compile command. This is a bug and we should fix it.

MortenMacFly:

--- Quote from: killerbot on July 10, 2008, 06:21:36 pm ---This is a bug and we should fix it.

--- End quote ---
I don't think this is a bug. Compiling a single file has nothing to to with any active project/target. So in fact choosing a compiler from an active target would in 99% be an error. compiling a single file always chooses the default compiler which is good (and by design!). In the end it's for quick tests anyways and not for "serious" programming.

killerbot:
yes, Martin is correct : no project --> no project compiler. But the inconsistency to use one, ends up in another might be interesting to have a look at.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version