[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Hvad skal jeg linke?



Hej
Jeg har et problem med at stykke kode.
Jeg har noget kode jeg gerne vil måle hvor lang tid det tager at udføre.
Jeg kiggede så i gettimeofday(2) og fandt der noget jeg kunne bruge. Jeg
includede så <sys/time.h> og <unistd.h> som der stod og ville så bruge
gettimeofday(...). Problemet er, at når jeg kompilerer det som et
C-program vil den ikke kendes ved typen timeval. Den siger følgende:
av2.c: In function `main':
av2.c:14: `timeval' undeclared (first use in this function)
av2.c:14: (Each undeclared identifier is reported only once
av2.c:14: for each function it appears in.)
(flere fejl som følge)
make: *** [av2] Error 1

Den vil godt kendes ved funktionen gettimeofday(...), men ikke struct'en
timeval.
Prøver jeg at kompilere det som et C++ program, er der derimod ingen
problemer.
Jeg har på fornemmelsen at jeg skal give den et l-flag når jeg
kompilerer det som et C-program, men i så fald hvilket? Jeg kan ikke
umiddelbart finde ud af hvilket ved at læse gettimeofday(2).

VH
Christian Hemmingsen




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *