In un file def.h ho questo codice:
codice:
#define MAX_LEN 50
typedef struct SCHEDA *agenda;
struct SCHEDA {
char cognome[MAX_LEN];
char nome[MAX_LEN];
char indirizzo[MAX_LEN];
char telefono[MAX_LEN];
};
SCHEDA leggi_scheda(void);
Se compilo il file (con Dev-C++) mi dà solamente l'errore "No rule to make target 'def.o'. Stop." che dovrebbe essere giusto.
Creo, successivamente, un file di nome main.c con le due include:
codice:
#include <stdio.h>
#include "defns.h"
e il main che non fa nulla.
Compilo, ottengo (" In file included from main.c" cioè def.h):
- syntax error before "leggi_scheda"
- [Warning] data definition has no type or storage class
L'errore è nella struct, penso..ma cosa può essere?