编译错误(我使用code :: blocks) [英] error of compilation (i use code::blocks)

查看:78
本文介绍了编译错误(我使用code :: blocks)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我的问题很简单,当我编译程序(一组文件源(和文件头))时,出现以下错误消息:

错误:代表"coef"的冲突代表
注意:之前的"coef"声明在这里

coef的声明如下:
typedef struct {float c [6];} coef;

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;




该声明在文件.c
中 在哪个conserne函数原型(位于fichier.h中)中,我也有相同的错误消息.

如果有人遇到了相同的错误,要么他对问题有想法:(



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 :(

推荐答案

您有多个符号coef的声明,必须修复它:如果许多源文件需要它,则在头文件中声明它;另一方面,如果您仅在一个源文件中需要它,则可以在其中声明它.
顺便说一句,您是否在使用针对标头多个包含的防护措施?

例如:

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:

// fichier.h
#ifndef __FICHIER_H__
#define __FICHIER_H__

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

#endif // __FICHIER_H__


这篇关于编译错误(我使用code :: blocks)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆