MW Ron <mwron RemoveThis @metrowerks.com> wrote in message news:<mwron-F7230D.10521629092003 RemoveThis @enews.newsguy.com>...
> In article <7f6c0a9a.0309282235.14b283bd RemoveThis @posting.google.com>,
> innocent_802000 RemoveThis @yahoo.com (Jay) wrote:
>
> >Hello all,
> > I am using CodeWarrior version 5. I am trying to
> >include sys/time.h file in a C project for gettimeofday function. I
> >went to Std C Console Debug Settings->Access Paths, included sys
> >directory. Project compiles without a hitch. When I try to build it,
> >Codewarrior says the following:
> >
> > Link Error:
> > undefined 'gettimeofday'
> > Project: myProject, Target: STd C Console Debug
> > referenced from main in myFile.c
>
> Turn on the require prototypes see if it compiles then Metrowerks time.h
> does not include gettimeofday.
>
> >I understand I have to make some changes in the linker options. But I
> >don't know where.
>
> gettimeofday is a posix function and not included in the Mac OS 9 system
> as far as I know.
>
> >Can anyone please point out the right location. I am new to CW, so
> >bear with me if I have asked anything simple.
>
> are you sure you are using CodeWarrior 5, the only way I know to do
> this is by using OS X and that really requires a newer version of
> CodeWarrior.
>
> It would be a lot better to know exactly what product you are using.
> i.e is it really CW 5 or is this CW IDE 5.0 or CW IDE 5.1 or CW IDE 5.5
> etc.
>
> Are you developing for OS 9/Carbon or is this a OS X Mach-O project
> I'm sure there is a way to do what you want, but I'd need more
> information to help you.
>
> Ron
Hi
Firstly, sorry for the delay in replying to this message.
I am using Codewarrior IDE 5. This is MAC OS X project. I created a
project following this path. I chose New-> MAC OS Stationary -> MAC OS
Carbon -> Standard Console -> C Console carbon to create a Hello world
project.
Yes, you are right, I need to include sys/time.h which is POSIX
function.
The project does not compile when I include time.h.
Again thanks<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: linker error