I have a C static library with algo_start.h and algo_start.c. In algo_start.c I have defined global variable like this:
static algo_start_t algo_start = {INTERNAL_STATE_IDLE, EXTERNAL_STATE_IDLE, NULL, 0, 0, 0, 0};
In newly created C project I included this static library, included algo_start.h, and tried to use functions defined in algo_start.h, but I get en error undefined reference to algo_start. I don't understand what and why (this) happens.
If I define algo_start
variable in algo_start.h, the project compiles with no errors.
My environment is Windows 10, CodeBlocks IDE with mingw compiler.