• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What does this link warning mean? can’t add line info to anonymous symbol
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What does this link warning mean? can’t add line info to anonymous symbol


  • Subject: Re: What does this link warning mean? can’t add line info to anonymous symbol
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 21 Jul 2010 21:55:33 +0200


Le 21 juil. 2010 à 21:43, Eric Gorr a écrit :


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.

This is from an object with lots of inline code:

I got 50 times the message:

ld: warning: can't add line info to anonymous symbol anon-func-0x0 from MyLibrary.a(MyObject.o)

By changing your destructor to a virtual one and by moving it to the cpp file you prevent the compiler to inline it.
Maybe this warning is related to inline functions.


-- Jean-Daniel




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: What does this link warning mean? can’t add line info to anonymous symbol
      • From: Eric Gorr <email@hidden>
References: 
 >What does this link warning mean? can’t add line info to anonymous symbol (From: Eric Gorr <email@hidden>)
 >Re: What does this link warning mean? can’t add line info to anonymous symbol (From: James Walker <email@hidden>)
 >Re: What does this link warning mean? can’t add line info to anonymous symbol (From: Eric Gorr <email@hidden>)
 >Re: What does this link warning mean? can’t add line info to anonymous symbol (From: Jean-Daniel Dupas <email@hidden>)
 >Re: What does this link warning mean? can’t add line info to anonymous symbol (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: What does this link warning mean? can’t add line info to anonymous symbol
  • Next by Date: Re: Making my code into an .app file/folder
  • Previous by thread: Re: What does this link warning mean? can’t add line info to anonymous symbol
  • Next by thread: Re: What does this link warning mean? can’t add line info to anonymous symbol
  • Index(es):
    • Date
    • Thread