Author Topic: Compiler options being ignored on project build  (Read 6542 times)

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Compiler options being ignored on project build
« on: August 23, 2010, 12:16:34 am »
Hi,

I'm noticing something strange. The 'Compile single file to object file' under Advanced compiler options isn't being used by the C::B build system when Borland toolchain is being used. Anyone have any idea why that is? Like for example, I changed 'Compile single file to object file' command line macro to look like this:

Code: [Select]
cd
$compiler -q $options $includes -o$object -c $file

Note that I have Borland 5.5, 5.82 profile selected when doing this.
Then I click Ok and Ok. Now if I build project with this profile those options for compiling isn't being used at all. The link object files seem to be fine though. I've tested other toolchain profiles like Visual C++ 2005/2008 and those profiles don't appear to have that problem.

Thanks

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Compiler options being ignored on project build
« Reply #1 on: August 25, 2010, 07:04:01 am »
cc1.exe: error: unrecognized command line option "-Wfatal-errors"
This leads me to believe codeblocks is ignoring my build settings.
Haha... sure things, that's why the compiler called by Code::Blocks complains...?! That doesn't sound very logical to me.

I'd say you should try the compilation at the command line. Then read the documentation of YOUR compiler (no idea which you have because you didn't tell) and decide whether it became deprecated or probably your compiler is too old. Then install a newer / appropriate compiler and you are done.

Keep in mind that C::B is just an IDE and we are supporting the use of literally hundreds of compilers (taking the different versions into account). So please choose the compiler that fit's your needs yourself.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Compiler options being ignored on project build
« Reply #2 on: August 25, 2010, 08:31:12 am »
So yes, your precious poorly named IDE does have a bug.
Look - your are close from being banned from our forums. If you continue to tell lies, don't listen to what we say and don't even try to understand and use your brain it makes no sense to me to allow you posting in our forums. This is nothing else than sarcastic SPAM.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Compiler options being ignored on project build
« Reply #3 on: August 25, 2010, 08:46:35 am »
What a novel way to deal with bug reports.  I should try this with my customers.
Well what a novel what a nice person you are. You made my day today, seriously. Thid is my last talk with you. May others have fun as I had if they want to...

BTW: You do know that your customers pay but you don't, do you?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Compiler options being ignored on project build
« Reply #4 on: August 25, 2010, 09:42:57 am »
Quote
whether or not I have the "stop on first error" option enabled

I found later there was a setting stored in the project that was listed in a compile block of its own, and was not displayed in any of the targets in the project.  So yes, your precious poorly named IDE does have a bug.

If you would seriously try to understand, you would have seen the drop-down-box, that let you decide whether you want to prepend or append the targets build-options to the project options or do not use the project options at all.

And anybody who is able to read, should also be able to understand that there are not just target, but also project options that can be common for all targets.

But this need of course a little bit willingness and the ability to learn and read, but you do not show either the one nor the other.

By the way:
a good start to understand any software, you are not common with, is to read the documentation: http://www.codeblocks.org/user-manual

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Compiler options being ignored on project build
« Reply #5 on: August 26, 2010, 01:18:00 am »
I think my post is getting derailed a bit here and I'm still searching for an answer to my original post...

Here's another example to help clarify what I'm asking, if I delete the command macro altogether under 'compile single file to object' and then try to build a project then it will still succeed! How is that possible? Like I said this only happens with the profile for borland. If I tried this instead under GCC or MSVC toolkit profile then it would fail to build properly like it should. The error it gives me in this case is 'Skipping file (no compiler program set)' which makes sense.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6948
    • My Best Post
Re: Compiler options being ignored on project build
« Reply #6 on: August 26, 2010, 01:26:18 am »
Have you turned on Full Compiler Logging and did it show a change when you edited the command?
Note, do not delete the command just do something like "$compiler -v file.c" as the command.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Make sure the default compiler is the compiler you are using.

Tim S.
« Last Edit: August 26, 2010, 01:33:30 am by stahta01 »
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 Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Compiler options being ignored on project build
« Reply #7 on: August 26, 2010, 01:40:15 am »
Have your turn on Full Compiler Logging and did it show a change when you edited the command?
Note, do not delete the command just do something like "$compiler -v file.c" as the command.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Make sure the default compiler is the compiler you are using.

Tim S.

Yes I did. I encountered this strange behavior when I was trying to turn off the banner suppression for borland. The original commandline has:

Code: [Select]
$compiler -q $options $includes -o$object -c $file
with -q option hiding the banner. After changing it to this:

Code: [Select]
$compiler $options $includes -o$object -c $file
I found it funny that it still hided the banner and my project didn't have -q anywhere in sight, at the target level or project wide. That's how I encountered this inconsistent behavior.

It's probably a bad idea to delete the command macro from that section but I did it to help me diagnose and troubleshoot the issue. Here is the commandline C::B invokes when I build a sample project:

Code: [Select]
//Compilation phase
//Note that that Borland profile is setup with an 'empty' command macro under
//'Compile single file to object' at this point in time.
bcc32.exe -q  -v -Od  -g0   -Ig:\Borland\BCC55\Include  -oDebug\main.obj -c main.cpp

Is anyone able to confirm and reproduce this behavior? Is it a problem with my configuration of C::B or is it an issue with C::B itself in the way the Borland profile is setup?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6948
    • My Best Post
Re: Compiler options being ignored on project build
« Reply #8 on: August 26, 2010, 01:58:22 am »
Just to confirm you ARE right clicking on the file and choosing build file? Note: I got the same results for rebuild.

After putting "$compiler -v file.c" in place of "$compiler -q $options $includes -o$object -c $file"
This is my build log

Code: [Select]
bcc32.exe -v file.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Error E2194: Could not find file 'file.c'
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

You are doing something wrong; tested using SVN 6271; downloading 10.05 to see if the problem is there. Same good result for CB 10.05.
EDIT: Are you using the native Code::Blocks system? Or are you using an Custom Makefile?

Tim S.
« Last Edit: August 26, 2010, 02:15:14 am by stahta01 »
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 Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Compiler options being ignored on project build
« Reply #9 on: August 26, 2010, 02:23:31 am »
Thanks for confirming, sounds like it's something with my configuration then. And no, no custom makefiles were used for this.