I'm sorry for what I'm sure is a simple mistake. But after a few hours I can't figure out what I'm doing wrong. I understand that extern
needs to be declared outside a function and defined within a function. But I can't get it to work.
Here is my minimal code error.
extern double d;
int main(void) {
d = 0;
return 0;
}
/home/0KzRYK/ccCTD3Lf.o: In function `main': prog.c:(.text.startup+0x3): undefined reference to `d' collect2: error: ld returned 1 exit status