Fehler beim compilieren !??!
Hallo Leute,
um ein LCD anzusteuern habe ich mir die Libary von Peter Fleuy geholt. Sein Beispielprogramm kann ich ohne Probleme compilieren.
Nun benutze ich das Beispielprogramm von:
https://www.roboternetz.de/wissen/in...D-Modul_am_AVR
AVR-GCC Programm
Das Programm zur Ansteuerung des Displays im 4-Bit I/O Mode. Verwendet wird die lcdlibrary von Peter Fleury.
Code:
#include <stdlib.h>
#include <avr/io.h>
#include "lcd.h"
int main(void)
{
/* Initialisiere Display, Cursor aus */
lcd_init(LCD_DISP_ON);
/* loesche das LCD Display und Cursor auf 1 Zeile, 1 Spalte */
lcd_clrscr();
/* String auf Display anzeigen */
lcd_puts("Hello world.");
}
Ich erzeuge mir das passende makefile, kopiere alle includes in den Ordner von main.c dann versuche ich zu kompilieren. (make all)
Da tut sich dann der Fehler auf:
Code:
> "make.exe" all
-------- begin --------
avr-gcc (GCC) 4.1.1 (WinAVR 20070122)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Linking: main.elf
avr-gcc -mmcu=atmega128 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o -std=gnu99 -Wundef -MMD -MP -MF .dep/main.elf.d main.o --output main.elf -Wl,-Map=main.map,--cref -lm
main.o: In function `main':
C:\Dokumente und Einstellungen\Marius\Desktop\RTCaC-Projekt\Code\LCD_Test_1/main.c:28: undefined reference to `lcd_init'
C:\Dokumente und Einstellungen\Marius\Desktop\RTCaC-Projekt\Code\LCD_Test_1/main.c:33: undefined reference to `lcd_clrscr'
C:\Dokumente und Einstellungen\Marius\Desktop\RTCaC-Projekt\Code\LCD_Test_1/main.c:36: undefined reference to `lcd_puts'
make.exe: *** [main.elf] Error 1
> Process Exit Code: 2
Selbst wenn ich #include "lcd.h" und die andern includes weglasse und den code in die main.c hineinkopiere ändert das nichts.
Was kann ich machen? Wo liegt der Fehler?
Warum schreibt man eigentlich hier #include "lcd.h" und nicht #include <lcd.h>?
Ich hoffe auf eure Hilfe!
Vielen dank .....
m&m