Hi,
I am trying to compile the following program :
#include <stdio.h>
#include <time.h>
int main( )
{
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);
}
and get the following compile/link time error message :
$ gcc date.c
/tmp/ccyJ9mFr.o: In function `main':
date.c:(.text+0 x23): undefined reference to `_strdate'
date.c:(.text+0 x41): undefined reference to `_strtime'
collect2: ld returned 1 exit status
$
It appeared that the program compiled OK. But the linker could not find
_strdate and _strtime.
Does anyone how to fix this problem?
Thank you for your help.
Akino.
I am trying to compile the following program :
#include <stdio.h>
#include <time.h>
int main( )
{
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);
}
and get the following compile/link time error message :
$ gcc date.c
/tmp/ccyJ9mFr.o: In function `main':
date.c:(.text+0 x23): undefined reference to `_strdate'
date.c:(.text+0 x41): undefined reference to `_strtime'
collect2: ld returned 1 exit status
$
It appeared that the program compiled OK. But the linker could not find
_strdate and _strtime.
Does anyone how to fix this problem?
Thank you for your help.
Akino.
Comment