Einzelnen Beitrag anzeigen

icqgoofy
(Gast)

n/a Beiträge
 
#8

Re: C-Programmierung "error: NULL undeclared"

  Alt 1. Jan 2007, 12:09
Also ich hab jetzt mal alles andere aus meiner
Datei gelöscht, sodass nur noch besagter Teil der
Funktion dort steht, ich habe den Quelltext von
Stefan Schrammel kopiert und engefügt, sodass der gesamte Quelltext
nun wie folgt aussieht:

Code:
#include <stdio.h>
#include <stdlib.h>                     
#include <time.h>                  

int main(void)                        
{
   time_t startzeit, endzeit;
   double diff;

   startzeit=time(NULL);
   diff=0;
   while(diff != 5)
      { 
      diff=difftime(endzeit,startzeit);
      endzeit=time(NULL);
      } 
   return 0;
}

Die komplette Fehlermeldung ist folgende:

Code:
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 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.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function `main':
test.c:7: warning: `endzeit' might be used uninitialized in this function
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o  --output test.elf -Wl,-Map=test.map,--cref -lm
test.o(.text+0xc): In function `main':
D:\Facharbeit\Dateien\Beispielprogramm\ASURO_src\Unser Programm (1)/test.c:10: undefined reference to `time'
test.o(.text+0x30):D:\Facharbeit\Dateien\Beispielprogramm\ASURO_src\Unser Programm (1)/test.c:14: undefined reference to `difftime'
test.o(.text+0x3a):D:\Facharbeit\Dateien\Beispielprogramm\ASURO_src\Unser Programm (1)/test.c:15: undefined reference to `time'
make: *** [test.elf] Error 1

> Process Exit Code: 2

Kann das evtl an meinem Programm Programmer Notepad 2 liegen?
  Mit Zitat antworten Zitat