Author Topic: Command-line compilation problem  (Read 6005 times)

Offline Calvin1602

  • Single posting newcomer
  • *
  • Posts: 3
Command-line compilation problem
« on: June 04, 2009, 03:27:57 pm »
Hi,

I'm experiencing some problems with the command-line build/rebuild option.
My project compiles when using the standard, GUI way, but fails to compiles with the following command :

codeblocks --build --target="Release_GTK_Linux" something.cbp

As far as I can see, C::B doesn't use the search directories specified in the Project build option window ( at least these, maybe manual defines and others too )

I'm running C::B 5607 ( compiled from svn checkout ) under Ubuntu 8.10, x86.

Thanks !

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Command-line compilation problem
« Reply #1 on: June 04, 2009, 05:17:34 pm »
Seems to work here.

Can you create a simple test-project, where this happens and attach it here ?

Offline Calvin1602

  • Single posting newcomer
  • *
  • Posts: 3
Re: Command-line compilation problem
« Reply #2 on: June 04, 2009, 05:47:14 pm »
Well, my bad. It works. But this leads me to point out a problem I've been experiencing with C::B since I've been using it : the project isn't automatically saved whenever a modification is made.

In this very case, this explains why the compilation failed (yes, I know, that was stupid :/ )

But whenever I add/remove a file/ an option, I usually commit the changes to my svn. The commit works, since other files have been changed. But the changes made to the project aren't committed, and it breaks the trunk.

So okay, my mistake, but would it be possible to have a fix for this ?

Thanks :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command-line compilation problem
« Reply #3 on: June 05, 2009, 06:39:48 am »
So okay, my mistake, but would it be possible to have a fix for this ?
I doubt it will. Consider that very often (e.g. through adding/removing defines) you are testing portions of the code. Such modifications in the project settings shall not be saved all the time. You really need to remember to save and do it yourself otherwise people (including me) surely would complain. However - there is an "autosave" plugin that might be a good solution for you. It saves files automatically in a certain time frame (which can be setup).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Zini

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Command-line compilation problem
« Reply #4 on: June 05, 2009, 01:37:33 pm »
Maybe the automatic project file save could be created in an optional fashion (workspace- or user-wide maybe)? I am in the same boat as Calvin1602 here. Can't remember how many botched SVN commits I produced because I forgot to save the project file.

From my point of view it is very unintuitive to have the project file on disc not in sync with the source files on disc. If you create a new source file with Code::Blocks, it is automatically written to the project directory, while the project file still lists the project as being without this file. IMHO this sounds wrong (though I can understand your argument about not wanting to save temporarily changed defines).

Regarding the auto save plugin: Sorry, but that isn't a solution. It doesn't guarantee, that the project file is saved in time for other actions, that may depend upon it. In fact it makes the situation worse, because it adds a non-deterministic element to it.

Offline Calvin1602

  • Single posting newcomer
  • *
  • Posts: 3
Re: Command-line compilation problem
« Reply #5 on: June 05, 2009, 03:53:11 pm »
What about an intermediate solution then ?
Something just like a messagebox each time you close the project window or add/remove files, which asks the uses what to do.
I wouldn't find this too intrusive, and practical enough.

What do you think ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command-line compilation problem
« Reply #6 on: June 06, 2009, 07:31:30 am »
What do you think ?
What about closing the project so that all file handles are properly closed before the commit? This is a one-click and not even a message box.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ