473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Link-time error when used _strdate() and _strtime()

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+0x23): undefined reference to `_strdate'
date.c:(.text+0x41): 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.
Apr 16 '08 #1
1 5279
oler1s
671 Expert 512MB
Aside: please use CODE tags when posting code. We programmers need to see properly formatted code, so if you want the most help for your questions, do take the time to add those tags. It doesn't take long, but lots more people will help you out.

You may be surprised to learn that _strdate and _strtime are not part of standard C. They are Microsoft extensions to time.h, which do not exist in other compilers. Hence, gcc can't compile the code, because _strdate and _strtime do not exist.
Apr 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Eric W. Holzapfel | last post by:
Hello PHPers, I have just installed RH Linux ES 3.0 (basic) kernel 2.4.21-9.EL, i686, Apache 2.0.X, and php 4.2.X. I have made no changes to the php.ini. I am trying to use the following page...
1
by: Jean-Marc Molina | last post by:
Hello, I'm trying to generate a RSS newsfeed using the DOM XML functions, but you already know that if you read my previous post . I'm able to create rss, channel and title elements but not a...
1
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
7
by: Shawn Windle | last post by:
----begin node.h-------- #ifndef NODE_H #define NODE_H #include <iostream> //NULL using namespace std; class node {
8
by: sudhirlko2001 | last post by:
How to swap two nodes of doubly Linklist
1
by: sri2097 | last post by:
Hi all, I have written a Link list implementation in Python (Although it's not needed with Lists and Dictionaries present. I tried it just for the kicks !). Anyway here is the code - # Creating...
3
by: nick | last post by:
I have the following code in my master page: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
8
by: Steve | last post by:
Hi; I had a big link checking job to do and it has been years since I have done anything like that so I found a test page to use that I knew had bad links on it( a friends site ) and I decided...
7
by: gehegeradeaus | last post by:
Can someone help me to make a regular expression for this sort of replacement : text with {link:pagehref}a link{/link}. replace to -> text with <a href="pagehref">a link</a> I tried...
4
by: perryche | last post by:
Is this possible? Instead of using the link wizard, can the FE/BE link be established any other way that users can simply type the link path? Thanks, Perry
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.