I have a curious problem: When building object files with -g
, the linker suddenly complains about missing symbols from libbar
on wich my tool depends indirectly through libfoo
. This does not happen without -g
.
These symbols seem to be coming from default parameters to functions in libfoo
which are objects from libbar
. These functions are, however, not used by my tool.
I wonder how this additional dependency is caused by debug builds - is it possible that these debug symbols are produced for all symbols, not only the ones I use, and for these debug symbols, the default parameters are also required?
This is with Sun Studio 5.10 on Solaris.