输入未定义的引用' OSD0_WRITE'

时间:2015-04-22 08:56:05

标签: c eclipse gcc compilation

我正在使用在Ubuntu上运行的Eclipse Luna中的gcc 4.8.2编译器编译C程序。

我收到一条错误消息:

Description Resource    Path    Location    Type
undefined reference to'OSD0_WRITE'  main.c  /stm32107/src   line 120 C/C++ Problem

的main.c

#include "OSD.H"

void OSD0_WRITE (   
uint8_t *YAZI,              uint8_t  FONT_PROPERTIES, 
uint16_t X_COORDINATE,      uint16_t Y_COORDINATE, 
uint8_t  FONT_RANGE_X,      uint8_t  FONT_RANGE_Y,
uint8_t  FONT_SIZE_X,       uint8_t  FONT_SIZE_Y, 
uint8_t  CHARACTER_DIM_X,   uint8_t  CHARACTER_DIM_Y,
uint8_t  FONT_BLINK,        uint8_t  FONT_FADE             );

int main(void)
{
uint8_t TEXT[] = "123456789012345678901234567890";

OSD0_WRITE(TEXT ,0x05,45,45,1,1,30,5,1,1,2,15);
} /* main.c */

OSD.C

#include "OSD.H"
void OSD0_WRITE (   
uint8_t *YAZI,              uint8_t  FONT_PROPERTIES, 
uint16_t X_COORDINATE,      uint16_t Y_COORDINATE, 
uint8_t  FONT_RANGE_X,      uint8_t  FONT_RANGE_Y,
uint8_t  FONT_SIZE_X,       uint8_t  FONT_SIZE_Y, 
uint8_t  CHARACTER_DIM_X,   uint8_t  CHARACTER_DIM_Y,
uint8_t  FONT_BLINK,        uint8_t  FONT_FADE             )
{

    TxBurst(0x400,FONT_SIZE_X, TEXT);

    OSD0_XY(X_COORDINATE,Y_COORDINATE);
.....
.....
....



} /* OSD0_WRITE */




*****建立日志************* 编译STM32F107 Cortex M3器件。这里有构建日志详细信息。


enter image description here

2 个答案:

答案 0 :(得分:0)

是像OSD.C一样大写的实际文件名吗?你可以重命名为至少有一个小写文件扩展名OSD.c并再试一次,因为gcc编译.C文件为C ++。 - 已回答@nos

答案 1 :(得分:0)

OSD.o未链接到解决方案,您应该将OSD.C添加到makefile中的源文件列表