1

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.

lytenyn
  • 819
  • 5
  • 21

1 Answers1

1

Maybe you also add some definitions, like DEBUG or something like this. And these defines may use some extra symbols from other libraries (for example, different logging libraries). If you give short example, it also may help

Alexey
  • 938
  • 5
  • 13
  • No, the code does not use DEBUG or other preprocessor magic. In fact, NDEBUG is not even set by our build system for non-debug builds. – lytenyn Nov 09 '12 at 14:18