salvodel
14-07-2008, 18:56
Salve a tutti quando compilo il mio programmino ho il seguente errore e non riesco a capire il motivo...forse sono un po stanco:coffee: e newbo :bimbo: per questo chiedo venia e sopratutto il vostro aiuto: fun_data.c:30: error: conflicting types for ‘normalizza’
fun_data.h:8: error: previous declaration of ‘normalizza’ was here
fun_data.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "fun_data.h"
#include "fun2.h"
int normalizza(double **maxmin, struct mydata *data)
{
int i, t;
int canali,punti;
double emax, emin;
...
...
...
return 1;
}
fun_data.h
#define directory "D:/dati"
#define fnINPUT "INPUT"
#define fnOUTPUT "OUTPUT"
#define filenameW1 "T1"
#define filenameW2 "T2"
int normalizza(double **maxmin, struct mydata *data);
Se tolgo #include "fun_data.h" dal sorgente fun_data.c giustamente mi dice che non trova gli altri define. Però perche non ho gli stessi errori anche per fun2.c che ha #include "fun2.c" e di conseguenza mi dovrebbe dire previous declaration of ‘funzione’?:confused:
Inoltre ho i segunti warnings
fun_data.h:4: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:4: warning: its scope is only this definition or declaration, which is probably not what you want
fun_data.h:8: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:12: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:16: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:20: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:24: warning: ‘struct mydata’ declared inside parameter list
La struttura è dichiarata in fun2.h ed è inclusa nel sorgente fun_data.c. A cosa sono dovuti tutti questi warning?:mbe:
Grazie a tutti.:help:
fun_data.h:8: error: previous declaration of ‘normalizza’ was here
fun_data.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "fun_data.h"
#include "fun2.h"
int normalizza(double **maxmin, struct mydata *data)
{
int i, t;
int canali,punti;
double emax, emin;
...
...
...
return 1;
}
fun_data.h
#define directory "D:/dati"
#define fnINPUT "INPUT"
#define fnOUTPUT "OUTPUT"
#define filenameW1 "T1"
#define filenameW2 "T2"
int normalizza(double **maxmin, struct mydata *data);
Se tolgo #include "fun_data.h" dal sorgente fun_data.c giustamente mi dice che non trova gli altri define. Però perche non ho gli stessi errori anche per fun2.c che ha #include "fun2.c" e di conseguenza mi dovrebbe dire previous declaration of ‘funzione’?:confused:
Inoltre ho i segunti warnings
fun_data.h:4: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:4: warning: its scope is only this definition or declaration, which is probably not what you want
fun_data.h:8: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:12: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:16: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:20: warning: ‘struct mydata’ declared inside parameter list
fun_data.h:24: warning: ‘struct mydata’ declared inside parameter list
La struttura è dichiarata in fun2.h ed è inclusa nel sorgente fun_data.c. A cosa sono dovuti tutti questi warning?:mbe:
Grazie a tutti.:help: