Hello, I've come across an interesting problem I haven't had before.
Here is an example:
I have a variable called testVar which should be available to any .c file that #includes test.h. For some reason though I receive this error:
Here is my code:
/tmp/ccKsh4uo.o: In function `myFunction':
test.c: (.text+0x5): undefined reference to `testVar'
collect2: ld returned 1 exit status
// File: test.h
extern char testVar;
Any ideas why this would happen?
// File: test.c
testVar = 'b';
char testVar = 'a';