Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

linker error

 
   Macintosh computer (Home) -> Programmer Code RSS
Next:  Panther & libcurl.a: Link Error: undefined: '..  
Author Message
Jay9

External


Since: Sep 28, 2003
Posts: 2



(Msg. 1) Posted: Mon Sep 29, 2003 2:35 am
Post subject: linker error
Archived from groups: comp>sys>mac>programmer>codewarrior (more info?)

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

I understand I have to make some changes in the linker options. But I
don't know where.
Can anyone please point out the right location. I am new to CW, so
bear with me if I have asked anything simple.
Thanks

 >> Stay informed about: linker error 
Back to top
Login to vote
MW Ron

External


Since: Aug 04, 2003
Posts: 1662



(Msg. 2) Posted: Mon Sep 29, 2003 1:52 pm
Post subject: Re: linker error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <7f6c0a9a.0309282235.14b283bd DeleteThis @posting.google.com>,
innocent_802000 DeleteThis @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

--
CodeWarrior Development Studio for Macintosh v9
Enhance Your Productivity and Shorten your Development Cycles
<http://store.metrowerks.com/>
Sales and Support 512-996-5300 800-377-5416
Ron Liechty - MWRon DeleteThis @metrowerks.com - <a style='text-decoration: underline;' href="http://www.metrowerks.com" target="_blank">http://www.metrowerks.com</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: linker error 
Back to top
Login to vote
Jay9

External


Since: Sep 28, 2003
Posts: 2



(Msg. 3) Posted: Sat Oct 18, 2003 10:55 pm
Post subject: Re: linker error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Programmer Code All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]