Hi,
Thanks for your quick reply. I took all the code as it is from rpm5.org and compiled , build and used library generated after build as it is.
I am not sure which header i need to include that contains its definition
Thanks...
Hi,
I am trying to write program for API of rpm (rpm5.org). I added library for it. And wrote sample program by including #include <rpm/rpmlib.h>.
I am getting following error while compiling source code "field `tv' has incomplete type"
I tried to debug code. This error is in "rpmsw.h" file and in following code
struct rpmsw_s
{
union
{
struct timeval tv;
unsigned long long int ticks;
unsigned long int tocks[2];
} u;
};
I am not sure why this error is happening. As I already complied rmp source code and installed. But this error is happening when i am trying to write sample program for rpm API.
Please help me to resolve this issue.
Thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> I tried this #include <sys/time.h> and now error is gone.
I'd suggest including <time.h> instead since timeval may not be defined there on all platforms (it's not on mine) but time.h should include all other necessary headers required.
>> shall i raise new question for this new error. please advice.
Yes please, different issue dictates different question. Thanks.
>> I'd suggest including <time.h> instead since timeval may not be defined there on all platforms
Actually, it's the other way around.
POSIX requires struct timeval to be defined in <sys/time.h>, and there's no mention of it being in <time.h> (although it could be). So, you've got more chance of finding it in <sys/time.h> than in <time.h>.
I'm not sure why that's not the case on your platform - GNU libc for example has it in <sys/time.h>. Which libc are you using ? Try compiling the below sample with a C compiler - it should work on a (partially) POSIX compliant system :
Business Accounts
Answer for Membership
by: evilrixPosted on 2009-09-16 at 01:27:46ID: 25343172
This means that the compiler has yet to see the full definition of the struct timeval. Have you missed out including the header that contains its definition maybe?