This simple code
struct Foo {
static double bar;
};
int main() {
Foo::bar = 15.0;
}
fails with the following error:
Undefined symbols for architecture x86_64:
"Foo::bar", referenced from:
_main in experiment-0579ea.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't understand why this doesn't work