On Jul 21, 2010, at 3:19 PM, Jean-Daniel Dupas wrote: Le 21 juil. 2010 à 21:03, Eric Gorr a écrit : On Jul 21, 2010, at 2:05 PM, James Walker wrote: On 7/21/2010 10:35 AM, Eric Gorr wrote:
I am working towards getting rid of all link warnings, but I am getting
three that I don't quite understand and a google search for this warning
hasn't been helpful.
The output to Xcode looks like:
ld: warning: can't add line info to anonymous symbol
__ZN16CLineAlignWidgetD0Ev.lsda from /path/to/CLineAlignWidget.o
What causes this warning and what can be done to fix it?
I have looked at the CLineAlignWidget class and it looks like other
classes which aren't generating this warning.
I don't know if this helps, but the c++filt tool demangles __ZN16CLineAlignWidgetD0Ev as CLineAlignWidget::~CLineAlignWidget().
Thanks. Well, in this specific case, it appears to have meant that I needed to add: virtual ~CLineAlignWidget( void ) {} However, with the other two similar warnings: ld: warning: can't add line info to anonymous symbol __ZN11CBaseWidgetD0Ev.lsda from /Path/To/CLightWidget.o ld: warning: can't add line info to anonymous symbol __ZN11CBaseWidgetD0Ev.lsda from /Path/To/C3DLocationWidget.o Which seem to be duplicates, c++filt shows: ~ $c++filt __ZN11CBaseWidgetD0Ev CBaseWidget::~CBaseWidget() and CBaseWidget already has virtual ~CBaseWidget( void ) {}
So, there appears to be something else going on here which a better understanding of what the link warning means would probably resolve.
FWIW, this is not a C++ specific warning. I got it with plain C code but didn't managed to find what it mean yet. Maybe we can find some information by looking in the ld sources.
Interesting. Do you have any more details? Do you still get the warning? If so, what, exactly, is the warning?
Well, I have been able to get rid of the final two warnings by changing
virtual ~CBaseWidget( void ) {}
to
virtual ~CBaseWidget( void );
and adding CBaseWidget::~ CBaseWidget( void ) {} to the cpp file. This seemed to get rid of the warning for C3DLocationWidget.o.
To get rid of the warning for CLightWidget, I had to do the same things with respect to ~CLightWidget.
I'm not particularly happy with these changes because I don't understand why they were necessary or if there was a better way to resolve the issue.
|