读书人

高手请帮小弟我解决下关于redeclarati

发布时间: 2012-03-28 15:40:03 作者: rapoo

高手请帮我解决下关于redeclaration的问题
我的文件包含CALCUL.h CALCUL.c CALCUL.prj
其中里面引用了STACK里面的STACK.C,STACK.H程序
在CALCUL运行的时候总是出现错误提示 redeclaration of Element
redeclaration of Next
而那两个重定义的变量正好是STACK里面的变量
请高手帮我看看是什么问题。。。
下面是头文件:
/*CALCUL.C*/
#include <stdio.h>
#include ".\code\stack\STACK.c "
#include ".\code\caculate\CALCUL.h "

/*CALCUL*/
#include <ctype.h>
#include <stdio.h>
#include ".\code\stack\STACK.h "LCUL.H*/

/*CALCUL.PRJ*/
.\code\caculate\CALCUL.c
.\code\caculate\CALCUL.h

[解决办法]
试试把
#include ".\code\stack\STACK.c "

中的.c改成.h
[解决办法]
/*CALCUL.C*/
#include <stdio.h>
#include ".\code\stack\STACK.h "
#include ".\code\caculate\CALCUL.h "

/*CALCUL.h*/

#ifndef _CLACUL_H_
#define _CLACUL_H_

#include <ctype.h>
#include <stdio.h>
#include ".\code\stack\STACK.h "
.....
#endif


/*STACK.h*/

#ifndef _STACK_H_
#define _STACK_H_

// your stack.h stuff
.....
#endif


[解决办法]
把你的stack.h和stack.c贴出来吧

读书人网 >C语言

热点推荐