I saw this post here: ld: undefined symbol vs ld: undefined reference and I don't think it really talks about what the differences are between these 2 linker errors.
I usually get undefined reference
linker errors when the linker can't find the definition of something (or I declared it and forgot to define it), but it seems undefined symbol
serves the same purpose (the answer in the above linked post gives an example that seems to be aligned with when undefined reference
arises, but maybe I'm missing some subtlety here?), so I'm a bit confused. Can someone clarify, perhaps with examples, of when each one arises during linking?
Edit: I didn't know the terminology for linker errors could be dependent on if using gnu
, clang
, etc...
In my case, I saw the undefined symbol
error when using clang++
and the error was
stderr: ld.lld: error: undefined symbol: custom::linear::adapt()
Is undefined symbol
the clang
counterpart to gnu
's undefined reference
?