Re: Cross compile to 10.3
Re: Cross compile to 10.3
- Subject: Re: Cross compile to 10.3
- From: Chris Griffin <email@hidden>
- Date: Tue, 20 Sep 2005 11:00:31 -0700
Thanks. The use of ftime is in a library I have downloaded from the
net. I'm compiling using ./configure;make from the command line. I
modified the code as follows:
old:
#include <sys/timeb.h>
new:
#include <AvailabilityMacros.h>
struct timeb {
time_t time; /* [XSI] Seconds since the Epoch */
unsigned short millitm; /* [XSI] Milliseconds since the
Epoch */
short timezone; /* [XSI] Minutes west of CUT */
short dstflag; /* [XSI] non-zero if DST in effect */
};
int ftime(struct timeb *) AVAILABLE_MAC_OS_X_10_4_AND_LATER ;
#define _SYS_TIMEB_H_
When I compile I get the following error:
platform.cpp:56: error: expected initializer before
'AVAILABLE_MAC_OS_X_10_4_AND_LATER'
I noticed that the AvailabilityMacros.h defined default values for
the min and max systems. Do I need to define anything else?
Thanks.
On Sep 19, 2005, at 9:53 PM, Chris Espinosa wrote:
On Sep 19, 2005, at 7:21 PM, Chris Griffin wrote:
After reading some of the postings on the subject, if I understand
correctly all I should have to do to get my project to run on
system 10.3 is to choose that as my Deployment Target. I've done
that however I'm getting the following error when I run on 10.3.9:
undefined reference to _ftime expected to be defined in /usr/lib/
libSystem.B.dylib
Unfortunately in Apple's Darwin headers, when ftime was added to
Tiger it wasn't marked with the AvailabilityMacro.h macro to
designate it weak-linked when building for systems prior to 10.4. So
instead of doing
#include <timeb.h>
you need to define your own ftime function:
#include <AvailabilityMacros.h>
int ftime(struct timeb *) AVAILABLE_MAC_OS_X_10_4_AND_LATER ;
#define _SYS_TIMEB_H_
and probably copy the timeb struct from /usr/include/sys/timeb.h as
well.
Please file a bug on this.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden