User forums > Using Code::Blocks
What's up with .depend files?
tankist02:
First of all many thanks for developers who created such a great product and then gave it out for free. I started using CB about a month ago and except for this particular issue found it quite useful.
Here is my problem - .depend files for all my projects contain only the following line:
# depslib dependency file v1.0
Because of that if a header file is changed I have to rebuild the whole workspace to guarantee to get the changes.
I did many builds/rebuilds for both Debug and Release mode using the global workspace or individual projects. I noticed that sometimes a project .depend would contain correct dependencies information, but then it would be gone after next edit/build. I couldn't observe any logic in how/when dependencies are generated (or rather not).
Editing .cpp files works fine - relevant libraries are built and dependent programs relinked.
I searched Internet and these forums for the topic and found a couple similar complains without any resolution.
BTW I have a parallel set of regular Makefiles that utilize recommended generation/usage of .d files - and this setup works correctly for the same source code.
My system:
30 C++ projects organized into one global workspace
CodeBlocks 10.05
Scientific Linux 6.1 x86_64
Any help would be greatly appreciated.
Alpha:
Is this what you are looking for?
You could also try Project->Properties...->Build targets (tab)->Dependencies... and add all the used header files as External dependency files (this would have to be done on all relevant projects).
tankist02:
I am not looking for how to set up inter-project dependencies. I did it and it works great. What I am looking for is how/when .depend files are generated. These files contain dependencies at the source code level, e.g. which .cpp files depend on which .h files. For some reason in my case all .depend files are empty, so when a header file is modified .cpp files that depend on it are not re-compiled.
Probably generation of .depend files happens at the Preprocessing phase (from the link you provided). Unfortunately there are no more details about what exactly going on at this phase.
Any other ideas/pointers?
tankist02:
More details about my setup:
In Toolchain executables I set to use ccache to speed up compilation:
C compiler: ccache_gcc
C++ compiler: ccache_g++
where ccache_gcc is the following script:
--- Code: ---#!/bin/sh
## Invoke g++ with ccache and pass all parameters to them
ccache gcc "$@"
--- End code ---
and
ccache_g++:
--- Code: ---#!/bin/sh
## Invoke g++ with ccache and pass all parameters to them
ccache g++ "$@"
--- End code ---
Alpha:
--- Quote from: tankist02 on September 19, 2011, 03:12:34 am ---What I am looking for is how/when .depend files are generated. These files contain dependencies at the source code level, e.g. which .cpp files depend on which .h files. For some reason in my case all .depend files are empty, so when a header file is modified .cpp files that depend on it are not re-compiled.
--- End quote ---
OK, that makes sense; unfortunately I do not have much experience with .depend files.
Have you tried
--- Quote from: Alpha on September 18, 2011, 10:37:43 pm ---You could also try Project->Properties...->Build targets (tab)->Dependencies...
--- End quote ---
Sometimes I find that simply opening the External dependency window causes Code::Blocks to correctly generate .depend files.
(Your compiler setup looks fine so I doubt that is the problem.)
@Anyone else: Perhaps someone with more experience in this area could share their thoughts?
Navigation
[0] Message Index
[#] Next page
Go to full version