Mark Lewis' BLOG

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

【笔记】NIOS Error: multiple definition of ***

在将C语言例程改制成NIOS工程的时候,遇到了下图的错误,而且报错得很厉害,五六十条Error全是这样的:

first defined here

multiple definition of "******"

最后感谢搜索引擎,问题解决了~
参考这篇文章:http://www.cppblog.com/baye/archive/2007/11/11/36398.html
在***.h文件中为函数都加上extern声明;而后在main函数中#include ***.h 文件而不要包含***.c文件。

例如我这里报错都集中在lcd.c文件中,在lcd.h文件中给所有报错函数加上extern声明,并在main.c中将原来的"#include lcd,c”改为"lcd.h”,问题解决,0 Errors, 0 Warnings !

posted on   Mark Lewis  阅读(1309)  评论(0编辑  收藏  举报

点击右上角即可分享
微信分享提示