I have a little trouble finding how do exactly the C++ compilers decide which symbol to be defined or undefined. What I mean is how do I know in a C++ source code if a variable/function will be compiled into a defined or undefined symbol. First I thought all defined variables/functions will be defined symbols, but seems like that's not what happens. Is there a way to exactly determine this considering static, extern, inline, ... keywords as well?
*update The question is not about definitions and declarations in C++, and not if my code will compile. Right now I think some functions/variables which are only declared in a C++ source become defined symbols if I compile the code and examine the object file with nm. I need this information : how does defined/declared C++ functions/variables compile to defined/undefined symbols to the object files (for example ELF).