Reputation: 99
I use header files to store a dataset in float arrays like so:
//header
float MNIST_test_data_label[1000][10] = {{...},...};
I include these headers in my main.c and can use the arrays, but the IDE (CodeBlocks) keeps making these headers when I build. I searched for hours now, trying to find a solution to make large amounts of data in form of arrays available to my project as "resources" without the compiler constantly rebuilding them.
Does anyone know a solution for this kind of problem?
Upvotes: 0
Views: 51
Reputation: 14157
Add an external declaration to the header. Add the actual definition to a dedicated C file:
// header
extern float MNIST_test_data_label[1000][10];
some C file:
float MNIST_test_data_label[1000][10] = {{...},...};
Note that a file with a single line as above should suffice.
Upvotes: 1