I'm compiling this super simple program written in C:
#include <stdio.h>#include <stdlib.h>int a = 1;int b = a;int main(void) { printf("%d", b); return 0;}
and the command I used to compile was:
gcc test.c -o test
but I'm getting this error message:
test.c:5:9: error: initializer element is not a compile-time constantint b = a; ^1 error generated.
Does anyone know how to possibly solve this problem? I searched similar questions but it turns out that most of them have some other conditions involved (e.g. static variables).
Thanks a lot!