[英]Error building C/C++ project in Eclipse: undefined referenced functions
我正在eclipse中制作一个C / C ++项目,自动生成makefile。 我得到了错误:
/home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:22:对bi3000_clearLines' /home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:25: undefined reference to
未定义引用bi3000_clearLines' /home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:25: undefined reference to
对bi3000_writeDisplay' /home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:31: undefined reference to
functions.c:28:未定义对bi3000_writeDisplay' /home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:31: undefined reference to
bi3000_writeDisplay的bi3000_writeDisplay' /home/globalcom/Desktop/Eclipse/Bi3000_testApplication/Default/../functions/functions.c:31: undefined reference to
bi3000_writeDisplay的引用
其中默认是eclipse生成的文件夹,并保存makefile。 我在project-> properties-> C / C ++ General->路径和符号中定义了include路径,并且项目中的所有#include似乎都可以识别,但是我遇到了此编译错误。
该函数在functions.h中定义,并在functions.c中声明:
void print_in_display(const char * line1,const char * line2,const char * line3,const char * line4){
const char firstline = 1;
bi3000_clearLines(0,7);
if(line1 != NULL)
writeDisplay(firstline, 0,0,8,(char *) line1);
if(line2 != NULL)
writeDisplay(firstline + 1, 0,0,8,(char *) line2);
if(line3 != NULL)
writeDisplay(firstline + 2, 0,0,8,(char *) line3);
if(line4 != NULL)
writeDisplay(firstline + 3, 0,0,8,(char *) line4);
}函数(writeDisplay)包含在librsm.h中。 并且在main()中调用print_in_display()
提前致谢
我假设它是文件扩展名中的C代码。 因此,在这种情况下,请尝试使用关键字extern并在functions.c中声明“ bi3000_writeDisplay”函数的原型。 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.