Potential of a compiler that creates the executable at once

Walter Bright newshound2 at digitalmars.com
Thu Feb 10 22:52:45 UTC 2022


On 2/10/2022 2:06 PM, Dave P. wrote:
> Undefined symbols for architecture arm64:
>    "__D7example9some_funcFiZi", referenced from:
>        __D7example3fooFiZi in example.o
>        __D7example3barFiZi in example.o
>        __D7example3bazFiZi in example.o
>        __D7example3quxFiZi in example.o
>        __Dmain in example.o
> ld: symbol(s) not found for architecture arm64

Things I have never been able to explain, even to long time professional 
programmers:

1. what "undefined symbol" means

2. what "multiply defined symbol" means

3. how linkers resolve symbols

Our own runtime library illustrates this bafflement. In druntime, there are 
these "hooks" where one can replace the default function that deals with 
assertion errors.

Such hooks are entirely unnecessary.

To override a symbol in a library, just write your own function with the same 
name and link it in before the library.

I have never been able to explain these to people. I wonder if it is because it 
is so simple, people think "that can't be right". With the hook thing, they'll 
ask me to re-explain it several times, then they'll say "are you sure?" and they 
still don't believe it.


More information about the Digitalmars-d mailing list