Author Topic: "Compile current file" - problem  (Read 8135 times)

Offline christobal

  • Multiple posting newcomer
  • *
  • Posts: 41
"Compile current file" - problem
« on: April 16, 2008, 08:55:30 am »
Hello all

I maybe have stumbled upon two bugs in the compiler plugin. The effect is that compiling of a single file doestn't work if:
1. The compiler is self-defined.
2. A rebuild or build hasn't been executed since Code::Blocks startup.

The problem is, that the project and Build Targets compiler switches and include paths are not added to the compiler invocation.
For example:
- the compiler exe is c166.exe
- the build targets compiler option is -bar; the compiler search directory is ../foo
The compiler command should be:
c166.exe -foo -I ../foo -c bar.c -o bar.obj

but instead the invocation is
c166.exe -c bar.c -o bar.obj

This happens only, if NO build or rebuild has been executed before. After that the command invocation is correct.

The second bug is maybe related to the first one:
The effect is that "compile current file" doesn't seem to use the "Compiler's installation directory path" which was set in the "Toolchain executables" tab of the compiler settings.

I found it out, because I have:
1. Two installed compilers with the same name of the executables (actually two different versions of the same compiler).
Lets say the installation paths are:
 c:\programs\compiler1\bin\cc166.exe      (c:\programs\compiler1\bin is in the PATH variable)
2. Two self-defined compiler sets in Code::Blocks; both with the same name of the binaries, but with different "installation directory paths in the Toolchain settings.
3. Build and Rebuild works well for both compilers.
4. "Compile current file" doesn't work if the project uses compiler2. The executable c:\programs\compiler1\bin\cc166.exe gets called instead of c:\programs\compiler2\bin\cc166.exe, because it's in the PATH variable.

This bug shows up every time, even if a build or rebuild has been executed before.

I have tested this under Code::Blocks 8.02 and svn revision 4999 on windows - both showed the same behaviour.