|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
[C] Aiutino su errore e warning
Salve a tutti quando compilo il mio programmino ho il seguente errore e non riesco a capire il motivo...forse sono un po stanco
e newbo per questo chiedo venia e sopratutto il vostro aiuto:
Codice:
fun_data.c:30: error: conflicting types for ‘normalizza’ fun_data.h:8: error: previous declaration of ‘normalizza’ was here Codice:
#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;
}
Codice:
#define directory "D:/dati" #define fnINPUT "INPUT" #define fnOUTPUT "OUTPUT" #define filenameW1 "T1" #define filenameW2 "T2" int normalizza(double **maxmin, struct mydata *data); Inoltre ho i segunti warnings Codice:
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 Grazie a tutti.
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." Ultima modifica di salvodel : 14-07-2008 alle 18:21. |
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Jul 2008
Città: Nel mio studio
Messaggi: 168
|
potresti fare uno schema di chi include chi e postare il codice degli altri file?
__________________
Since Rocco Siffredi, the saying "pain in the ass" got a total new meaning |
|
|
|
|
|
#3 |
|
Bannato
Iscritto dal: Feb 2005
Città: Roma
Messaggi: 7029
|
dichiara struct mydata prima della funzione normalizza.
|
|
|
|
|
|
#4 | |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Quote:
main.c #include "fun_data.h" #include "fun2.h" In fun_data.c ci sono le funzioni mentre in fun_data.h ci sono le intestazioni ed in piu all'inizio ci sono dei define per le directory ed i file. Per adesso ho risolto spostando i define dal header al sorgente e togliendo #include "fun_data.h" da sorgente fun_data.c. Quello che non capisco è perche invece nella sorgente fun2.c posso mettere #include "fun2.h" dove è definita una struttura e non mi da errore? Grazie
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
|
|
|
|
|
#5 |
|
Member
Iscritto dal: Jul 2008
Città: Nel mio studio
Messaggi: 168
|
Protrebbe essere che includi all'interno del progetto 2 volte lo stesso file
Nelle librerie .h metti questo all'inizio (differente per ogni file h) Codice:
#ifndef LIBRERIA_UNO #define LIBRERIA_UNO .... ..... (codice libreria) .... ..... .... ..... #endif
__________________
Since Rocco Siffredi, the saying "pain in the ass" got a total new meaning |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 12:18.










e newbo
per questo chiedo venia e sopratutto il vostro aiuto:










