resource.h

Find out how to get that @*&^$&@ thing to compile!

resource.h

Postby Atlantis » Fri Jan 03, 2003 4:37 am

I am having trouble compling some code. When trying To Make I get the Following...

In file included from comm.c:21:
/usr/include/sys/resource.h:81: field `ru_utime' has incomplete type
/usr/include/sys/resource.h:82: field `ru_stime' has incomplete type

I checked The the resource.h file, and It "looks" ok...

struct rusage {
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
...

Can Anyone Give any ideas?
Atlantis
 
Posts: 3
Joined: Thu Jan 02, 2003 8:00 pm

Re: resource.h

Postby Atlantis » Sat Jan 04, 2003 3:47 am

Well... I haven't Changed the resource.h from what OSX10.2 gives ya... I looked thru it all... I didn't see a decloration for timeval, and the only include is "sys/appleapiopts.h"
Atlantis
 
Posts: 3
Joined: Thu Jan 02, 2003 8:00 pm

Re: resource.h

Postby <trevorsm> » Sat Jan 04, 2003 5:04 am

I checked out the resource.h header file on my computer and I didn't find a declaration for timeval either. I wrote a quick mock up program that included the code...

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr><pre>
struct parent
{
struct child num_one;
struct chile num_two;
};
</pre>[/quote]

...and surely enough, I was given an "incomplete type" error. From that, two things come two mind--this file must be meant to be included into another file which does define the timeval structure and the person who wrote this file was using very bad form. [img]images/icons/smile.gif"%20border="0[/img]

With all that said, I need a lot more info to figure out what's going on... What does the file that includes resources.h look like? What other headers does it include?

Has anyone else heard of tis timeval structure? I've never heard of or used it before.
<trevorsm>
 

Re: resource.h

Postby <trevorsm> » Sat Jan 04, 2003 8:15 am

Hm, I've never seen an error of that type before... The syntax looks perfect (I could be overlooking something though) as well. Perhaps the error is coming from the timeval structure? Is timeval something you declared or is it from another header you're using (too lazy to look it up).
<trevorsm>
 

Re: resource.h

Postby Atlantis » Sun Jan 05, 2003 2:51 am

On searching a little bit through all the sys/ foles... i did find a Reference to timeval in the sys/time.h I added an Include line for sys/time.h and it got rid of the error... thanks for the help!!
Atlantis
 
Posts: 3
Joined: Thu Jan 02, 2003 8:00 pm


Return to Compile Problems

Who is online

Users browsing this forum: No registered users and 10 guests

cron