|
本帖最后由 454234682 于 2012-10-5 10:38 编辑
我用AVR-GCC编译程序,老是出现这个问题,解决不了哇,在线等!!!!!谢谢大侠
老是出现\M16-GCC例程\lcd12864/main.c:16: undefined reference to `LCD_Init'
可是我已将包含了#include "lcd12864.h"
下面lcd12864.h文件
#ifndef _LCD12864_H_
#define _LCD12864_H_
#include <avr/io.h>
#define LCD12864_CS PORTA=(1<<7)
#define LCD12864_SID PORTA=(1<<6)
#define LCD12864_SCK PORTA=(1<<5)
#define uchar unsigned char
#define uint unsigned int
void LCD_Init(void);//液晶初始化
uchar LCD_ReceiveByte(void);
void LCD_CheckBusy(void);//判断液晶是否忙
void LCD_WriteCommand(uchar Cbyte);//写指令
void LCD_WriteData(uchar Dbyte);//写数据
uchar LCD_ReadData(void);
void LCD_DisplayChinese(uchar Addr,uchar *p);//显示中文或字符串
void LCD_DisplayNumber(uchar Addr,int num);//显示数字
void LCD_DisplayCLR(void); //(开机消除噪点)
#endif
难道是Makfile没有包含.C文件?有人知道怎么弄嘛?
这样写对不对啊?
# Target file name (without extension).
TARGET = main
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
OBJDIR = .
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c
SRC = lcd12864.c
# List C++ source files here. (C dependencies are automatically generated.)
CPPSRC =
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
# Optimization level, can be [0, 1, 2, 3, s]. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|