Hallo,
ich versuche gerade eine c++ Library aus einem Arduino Projekt
in ein C-Library umzuschreiben. Es geht um die Berechnung des
Sonnenaufgangs/Untergangs. Ich arbeite unter AVR-Eclipse.
Das ganze Projekt lässt sich kompilieren aber erzeugt zum Ende
einen Fehler, den ich nicht verstehe:
1 | #include <avr/io.h>
|
2 | #include "myTimeLord.h"
|
3 |
|
4 | struct myTimeLord_struct marburg;
|
5 |
|
6 | uint8_t sunrise[6]; // Datum/Zeit Sonnenaufgang
|
7 | uint8_t sunset[6]; // Datum/Zeit Sonnenuntergang
|
8 |
|
9 |
|
10 | int main(void)
|
11 | {
|
12 |
|
13 | TimeLord_Init(&marburg);
|
14 | TimeLord_Position(&marburg, 50.7991, 8.7805);
|
15 | TimeLord_TimeZone(&marburg, 120);
|
16 | TimeLord_SunRise(&marburg, sunrise);
|
17 |
|
18 | for(;;)
|
19 | {
|
20 |
|
21 | }
|
22 |
|
23 | }
|
Und hier die Fehlermeldung:
21:08:45 **** Clean-only build of configuration Debug for project
TimeLord-Test ****
make clean
rm -rf ./main.o ./myTimeLord.o ./main.d ./myTimeLord.d
TimeLord-Test.lss sizedummy TimeLord-Test.elf
21:08:45 Build Finished (took 375ms)
21:08:45 **** Incremental Build of configuration Debug for project
TimeLord-Test ****
make all
Building file: ../main.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -Os -fpack-struct -fshort-enums -std=gnu99
-funsigned-char -funsigned-bitfields -mmcu=atmega16 -DF_CPU=1000000UL
-MMD -MP -MF"main.d" -MT"main.d" -c -o "main.o" "../main.c"
Finished building: ../main.c
Building file: ../myTimeLord.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -Os -fpack-struct -fshort-enums -std=gnu99
-funsigned-char -funsigned-bitfields -mmcu=atmega16 -DF_CPU=1000000UL
-MMD -MP -MF"myTimeLord.d" -MT"myTimeLord.d" -c -o "myTimeLord.o"
"../myTimeLord.c"
Finished building: ../myTimeLord.c
Building target: TimeLord-Test.elf
Invoking: AVR C Linker
avr-gcc -Wl,-Map,TimeLord-Test.map -mmcu=atmega16 -o "TimeLord-Test.elf"
./main.o ./myTimeLord.o
c:/winavr/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr5\libc.a(fp_po
wsodd.o): In function `__fp_powsodd':
(.text.avr-libc.fplib+0x10): relocation truncated to fit: R_AVR_13_PCREL
against symbol `__mulsf3' defined in .text section in
c:/winavr/bin/../lib/gcc/avr/4.3.3/avr5\libgcc.a(_mul_sf.o)
c:/winavr/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr5\libc.a(fp_po
wsodd.o): In function `__fp_powsodd':
(.text.avr-libc.fplib+0x20): relocation truncated to fit: R_AVR_13_PCREL
against symbol `__mulsf3' defined in .text section in
c:/winavr/bin/../lib/gcc/avr/4.3.3/avr5\libgcc.a(_mul_sf.o)
make: *** [TimeLord-Test.elf] Error 1
21:08:48 Build Finished (took 2s.484ms)
Nehme ich aus der letzen aufgerufenen Funktion
TimeLord_SunRise(&marburg, sunrise);
ein paar Zeilen raus, kompiliert das Ganze ohne Fehler durch.
Habe mal das Ganze Projekt als Attachment angehängt.
Vielleicht kann mir ja jemand hier weiterhelfen :-)
Viele Grüße
Elmar