To avoid some linking errors

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 30 15:04:47 PDT 2012


On 10/30/12 6:00 PM, Walter Bright wrote:
> I find it ironic that you mention grep. Grep is what I suggested in the
> link to dealing with the issue, but nobody likes that answer.
>
> http://www.digitalmars.com/ctg/OptlinkErrorMessages.html#symbol_undefined

Mangling is the issue here.

>>> The site of the usage isn't remotely useful for answering either of
>>> those
>>> questions and those are the ones that form the disconnect between the
>>> compiler, who believed it existed and let the code pass to the next
>>> stage), and the linker.
>>
>> Non-issue. Grep takes care of that. Finding the cross-references and the
>> overloading part are the hard problems here. This is so clear to me
>> for so many
>> reasons, I am paralyzed by options.
>
> If you're missing a definition, you need to find the declaration, not
> the use, because that's where the missing definition needs to go.
> And finally, grepping for an un-mangled name doesn't work for overloaded
> names.

Upon more thinking, I agree that BOTH declarations and call sites must 
be clearly pointed in the errors output by the linker. But I'll still 
point out that the real difficulty is finding the calls, not the 
declarations. I don't ever remember having a hard time "where is this 
declared?" Instead, the hard problem has always been "What is the call 
chain that leads to an undefined symbol?"


Andrei


More information about the Digitalmars-d mailing list