Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody
My question is simple, when I compile my program ( a group of file source(, and of files headers) I have the following error message:

Error: conflicting typify for ' coef '
Note: previsous declaration of ' coef ' was here

The declaration of coef is the following one:
typedef struct {float c[6];} coef;



This declaration is in a file .c
I also have the same error message in what conserne prototype of function (which is in a fichier.h)

If somebody has confronted to the same error , either that he have an idea of the probleme :(
Posted
Comments
LaxmikantYadav 15-Feb-11 5:39am    
Can you show us the code so it is easy to point out the error

1 solution

You have multiple declarations of the symbol coef and you must fix it: if many source files need it then declare it in a header file. On the other hand, if you need it just in one source file then you may declare it there.

By the way, are you using guards against header multiple inclusions?

For instance:

C
// fichier.h
#ifndef __FICHIER_H__
#define __FICHIER_H__

// declarations here...
// ...

#endif // __FICHIER_H__
 
Share this answer
 
v2
Comments
Sandeep Mewara 15-Feb-11 6:36am    
Comment from OP:No i did not used a guards against header multiple inclusion( thanks for information Smile , but for declaration of variable i read that it must be write in file.c
CPallini 15-Feb-11 6:51am    
Variable DEFINITIONS must be written in source (*.c) files (for instance you might declare a variable as 'extern' inside a header file). In any case, you posted about a 'typedef', not a variable.
Sergey Alexandrovich Kryukov 15-Feb-11 22:18pm    
Correct, my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900