Linkerproblem with mcal/datetime.h

From: Thomas (iwtbel_at_web.de)
Date: 10/14/04


Date: Thu, 14 Oct 2004 20:29:58 +0200

Hi everybody,
I haven't found any fitting previous question/answer,
so I need to bother you.

I can't figure out where the problem lies therefor I
post the entire code of my program, followed by the
error output of gcc:

#include <mcal/datetime.h>
#include <stdio.h>

int main( int argc, char **argv )       {
  int y = 1980,
      m = 9,
      t = 28,
      doy;
  struct datetime *date;

  dt_now(date);
  doy = dt_dayofyear(date);
  dt_setdate(date,y,m,t );
  if(dt_dayofyear(datum) == (doy+2))    {
                printf("2 days left");
        }
}

erroroutput:

/tmp/ccoaguJ2.o(.text+0x2c): In function `main':
: undefined reference to `dt_now'
/tmp/ccoaguJ2.o(.text+0x3a): In function `main':
: undefined reference to `dt_dayofyear'
/tmp/ccoaguJ2.o(.text+0x51): In function `main':
: undefined reference to `dt_setdate'
/tmp/ccoaguJ2.o(.text+0x5f): In function `main':
: undefined reference to `dt_dayofyear'
collect2: ld returned 1 exit status

Can anybody explain me why this errors occur?

I've looked in time.h, but this struct doesn't
seem to be helpfull for comparing dates; Are there
any other usefull structs I could use?