PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Fehler: implicit declaration of function `_SFR_IO8'



MartinITM
16.05.2005, 11:03
Hallo,

wollte mal WinAVR testen.
Mein Programm:

#define _AVR_IO_H_
#include <io2313.h>


int main(void)
{
while(1)
{
PINB = 0x01;
}
}

Mein Fehler:

> "make.exe" all
set -e; avr-gcc -MM -mmcu=at90s2313 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.lst -std=gnu99 test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d

-------- begin --------
avr-gcc (GCC) 3.4.3
Copyright (C) 2004 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.


Size before:
test.elf :
section size addr
.text 108 0
.data 0 8388704
.bss 0 8388704
.noinit 0 8388704
.eeprom 0 8454144
.debug_aranges 20 0
.debug_pubnames 36 0
.debug_info 128 0
.debug_abbrev 107 0
.debug_line 106 0
.debug_str 57 0
Total 562




Compiling: test.c
avr-gcc -c -mmcu=at90s2313 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.lst -std=gnu99 test.c -o test.o
test.c: In function `main':
test.c:9: warning: implicit declaration of function `_SFR_IO8'
test.c:9: error: invalid lvalue in assignment
make.exe: *** [test.o] Error 1

> Process Exit Code: 2
implicit declaration of function `_SFR_IO8' was muss ich da anders einstellen?

danke
Martin

dark emporer
16.05.2005, 11:17
wenn du #define _AVR_IO_H_ schreibst dann wird nicht mehr eingebunden
#include <io2313.h> .
Auserdem benutze am besten io.h anstat io2313.h.
Entferen #define _AVR_IO_H_ weil es von io.h ausgefürt wird.


#include <io.h>
int main(void)
{
while(1)
{
PINB = 0x01;
}
}


in der makefile
# MCU name
MCU = at90s2313

MartinITM
16.05.2005, 11:41
danke für die schnelle antwort.
hatte da noch das problem mit dem include pfad.
super nun geht es.
\:D/

martin