LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2003, 09:20 AM   #1
kopernic
LQ Newbie
 
Registered: Mar 2003
Location: Wroclaw, Poland
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Unhappy RPC programming problem


When i want to build any file using rpc header files my gcc hugest bunch of errors. Why?

"
cc -c -o prog.o prog.c
In file included from prog.c:4:
/usr/include/rpcsvc/rusers.h:28: parse error before '.' token
/usr/include/rpcsvc/rusers.h:30: parse error before '}' token
/usr/include/rpcsvc/rusers.h:76: parse error before '.' token
/usr/include/rpcsvc/rusers.h:88: field `ui_utmp' has incomplete type
"

There is no code in prog.c except main() and #include...

and i think rusers.h is in alright :/

What's wrong ??
 
Old 03-15-2003, 06:30 AM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
It looks like you have the word ut_time #defined somewhere else?
do you have any other #includes in your program before rusers.h?
 
Old 03-15-2003, 04:58 PM   #3
kopernic
LQ Newbie
 
Registered: Mar 2003
Location: Wroclaw, Poland
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 0
whole program:

#include <stdio.h>
#include <rpc/rpc.h>
#include <utmp.h>
#include <rpcsvc/rusers.h>

main(void)
{
}


Maybe "RPC problem" is too scary title...

Just problem with headers...

THX.
Mateusz "Kopernic" Wronski
 
Old 03-16-2003, 08:02 AM   #4
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
try this...

#define _NO_UT_TIME
#include <stdio.h>
.
.
.
 
Old 03-16-2003, 05:06 PM   #5
kopernic
LQ Newbie
 
Registered: Mar 2003
Location: Wroclaw, Poland
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 0
Ok, thx, it works. Now i need a little explain...

What's with this (f..n) time ??
and how it is connected to some ')' and '.' in code ??
 
Old 03-17-2003, 06:02 AM   #6
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
read the bit in /usr/include/bits/utmp.h

in utmp.h there is...
# define ut_time ut_tv.tv_sec

in rusers.h there is...
int ut_time;

if you include utmp.h before rusers.h, it'll be compiled as....
int ut_tv.tvsec;

....which won't compile.





If utmp.h is included before rusers.h
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS RPC: Port mapper failure - RPC: Unable to receive KEJP Linux - Networking 6 12-18-2006 02:14 AM
rpc.lockd & rpc.statd twantrd Linux - General 1 05-21-2005 09:24 AM
Unmounting NFS filesystems: Cannot MOUNTPROG RPC: RPC ErnstVikenstein Linux - General 4 05-31-2003 12:10 AM
RPC Programming in Linux obashir Linux - Software 2 12-08-2002 10:52 PM
RPC Programming in Linux obashir Linux - Networking 1 12-06-2002 10:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration