I am starting a new project in codeblocks using the default settings. I have three .c files that I need to link together, and I am apparently doing it wrong.
main.c looks like this:
Code:
#include<time.h>
#include<windows.h>
#include<stdint.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include"detection.h"
#include"io.h"
#include"butterworth.h"
int main(int argc, char **argv)
{
//allocate and read configuration struct
configuration *config;
if ((config = malloc(sizeof(configuration)))==NULL)
{
printf("Cannot allocate config structure\n");
abort();
}
read_config(config);
return 0;
}
detection.c looks like this:
Code:
#include"detection.h"
nothing there yet, still working on getting things set up properly.
detection.h defines a struct
Code:
struct Configuration
{
...stuff...
};
typedef struct Configuration configuration;
io.c reads stuff into the struct
Code:
#include"io.h"
#define STRLENGTH 1024
void read_config(configuration *config)
{
...stuff....
}
and io.h just declares that function
Code:
void read_config(configuration *config);
When I try to build, I get "Error: unknown type name configuration"
so apparently things are not being included properly. Can anyone suggest what I am doing wrong?