473,320 Members | 1,695 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,320 software developers and data experts.

Linkerproblem with mcal/datetime.h

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?
Nov 14 '05 #1
2 1436
Thomas <iw****@web.de> wrote in news:ck*************@news.t-online.com:
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> This header is not part of ISC C.
#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");
********} Nasty indenting!
}

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?


It says exactly what's happening. The linker cannot find the
implementation of the non-ISO C functions listed. Including a header file
only tells the compiler what the function signatures look like. The actual
implementation of the functions is usually in a library or object file. We
can't help you with that here in comp.lang.c.

By the way, why post to comp.lang.c then truncate it from the followup
list?

--
- Mark ->
--
Nov 14 '05 #2
Groovy hepcat Thomas was jivin' on Thu, 14 Oct 2004 20:29:58 +0200 in
comp.lang.c.
Linkerproblem with mcal/datetime.h's a cool scene! Dig it!
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>
Non-standard header.
#include <stdio.h>

int main( int argc, char **argv )*******{
Unused parameters. What's wrong with the simpler "int main(void)"?
**int*y*=*1980,
******m*=*9,
******t*=*28,
******doy;
**struct*datetime**date;
Type struct datetime either undefined or defined in non-standard
header.
**dt_now(date);
Function dt_now() either undeclared or declared in non-standard
header.
**doy*=*dt_dayofyear(date);
Function dt_dayofyear() either undeclared or declared in
non-standard header.
**dt_setdate(date,y,m,t*);
Function dt_setdate() either undeclared or declared in non-standard
header.
**if(dt_dayofyear(datum)*==*(doy+2))****{

Function dt_dayofyear() either undeclared or declared in
non-standard header. Variable or macro datum either undeclared or
declared in non-standard header.
****************printf("2*days*left");
********}
No return statement. This is OK in C99 (for main() only), though
still not adviseable. It is an error in C90.
}

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?
You didn't link in whatever library provides those functions, maybe?
I've looked in time.h, but this struct doesn't
What struct? You mean struct tm?
seem to be helpfull for comparing dates; Are there
any other usefull structs I could use?


For what? It's not entirely clear what you are trying to do.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Max M | last post by:
# -*- coding: latin-1 -*- """ I am currently using the datetime package, but I find that the design is oddly asymmetric. I would like to know why. Or perhaps I have misunderstood how it...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
6
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference...
5
by: I am Sam | last post by:
I have created this DateTime object and instanced it I think correctly DateTime myClubNow1=new...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.