Author Topic: Auto Save before Build  (Read 12462 times)

Offline sipickles

  • Multiple posting newcomer
  • *
  • Posts: 19
Auto Save before Build
« on: November 10, 2007, 07:10:27 pm »
Hi,

Is there any way to get C:B to save all open files before running a build, when the BUILD button is pressed?

I get errors I've fixed, coz I haven't pressed SAVE then BUILD. Nice to just press BUILD :)

Thanks

Si

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Auto Save before Build
« Reply #1 on: November 11, 2007, 02:06:47 pm »
Code::Blocks saves all files that are part of the current project when you run a build.

It does not save any other files that you may have incidentially open (and possibly modified). No, this will not be implemented.

The solution is to add all files that belong to the project to the project. Not only does this make your workflow more comfortable (as you can open the files from the project manager), but it also tells the IDE that those files are important to the project.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Story

  • Single posting newcomer
  • *
  • Posts: 9
Re: Auto Save before Build
« Reply #2 on: November 23, 2011, 10:18:01 pm »
Is there anyway to get it to autosave the project itself when building? Often times I'll work on a project for a while, adding files, changing settings, etc. And then when I restart my computer, none of the changes to the project were saved. I have to go back and readd all the project files and it is very annoying.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Auto Save before Build
« Reply #3 on: November 23, 2011, 11:11:03 pm »
Is there anyway to get it to autosave the project itself when building?
Not exactly (at least that I know of), but you can save/backup project (and source) files at regular intervals with the Autosave plugin.

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: Auto Save before Build
« Reply #4 on: December 30, 2011, 02:07:51 pm »
Code::Blocks saves all files that are part of the current project when you run a build.

This does not seem to be happening for me. I only have one file, it is part of the  project, and I have to save it every time before I build (with F9).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Auto Save before Build
« Reply #5 on: December 30, 2011, 02:55:57 pm »
Code::Blocks saves all files that are part of the current project when you run a build.

This does not seem to be happening for me. I only have one file, it is part of the  project, and I have to save it every time before I build (with F9).
Which OS and version of C::B do you use ?

Can you provide a simple test project where this happens ?
And please give a step by step guide to reproduce this.

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: Auto Save before Build
« Reply #6 on: December 30, 2011, 04:09:05 pm »
I am running on Ubuntu 11, C:B 10.05.

I have attached my project and source files. All I have to do is press F9 - it runs but it does not take into account the latest changes (so I have to do ctrl-S then F9 in order for it to work properly).

Cheers!

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: Auto Save before Build
« Reply #7 on: December 30, 2011, 04:28:28 pm »
Might be worth noting that my source file is in a dropbox folder.

EDIT: I have tried putting the source file elsewhere and the problem still exists.

 I have noticed exactly what the problem seems to be: I have to actually hit F9 once, let the code start running, stop the code (or let it finish) then hit F9 again. When it runs the second time, it has taken account of my changes - not on the first go though!
« Last Edit: December 30, 2011, 04:34:53 pm by mark1977 »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Auto Save before Build
« Reply #8 on: December 30, 2011, 04:29:49 pm »
I am running on Ubuntu 11, C:B 10.05.

I have attached my project and source files. All I have to do is press F9 - it runs but it does not take into account the latest changes (so I have to do ctrl-S then F9 in order for it to work properly).

Cheers!
Works fine here with gcc instead of Intel-compiler.

Is the cpp file a local file (from its path it does not look so) ?
If it's not, does it work with a local copy of the file ?

My reply and your post have crossed each other.

Offline mark1977

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: Auto Save before Build
« Reply #9 on: December 30, 2011, 04:41:24 pm »
Thanks jens - I tried with gcc and it works fine. So there is something about using the intel compiler that causes this problem (and possibly other compilers too). Does that make any sense to you - can you think of any reason why I need to build twice with the intel compiler? (The intel compiler is essential for my work unfortunately)

Thanks.

EDIT: now I have switched back to Intel and the problem is gone! Strange but good.
« Last Edit: December 30, 2011, 04:43:06 pm by mark1977 »