Operating System - HP-UX
1833861 Members
2232 Online
110063 Solutions
New Discussion

Re: compiling programs with getprpwent (and alike) function on HP UX 10.20

 
Charles Xaivier
Occasional Contributor

compiling programs with getprpwent (and alike) function on HP UX 10.20

Hi

I'm sure this is an easy problem and someone's probably asked this before but if anyone knows the answer please tell me causing it's driving me insane.

Eg.

#include
#include
#include
#include

int main(void)
{
getprpwnam("User");
printf("Hello World!");
return 0;
}

I can compile that no problems in HP UX 11.00 using gcc.

However when I compile it on HP UX 10.20 it doesn't wanna work with gcc or aCC. It works fine using cc -Ae -lsec.

The error I get is
/usr/include/prot.h: 466: to many arguements to function 'struct pr_passwd * getprpwnam()'

I noticed that with the prot.h file in 10.20 the the function prototypes have no arguements for all the getprpwent type functions.

Eg. It's defined as
struct pr_passwd * getprpwnam()

instead of
struct pr_passwd * getprpwnam(const char *name)

Can someone please tell me what I must do to get it to compile (including compiler line options) on 10.20 using aCC or gcc.(Preferable gcc)

Thank you very much.
1 REPLY 1
Santosh Nair_1
Honored Contributor

Re: compiling programs with getprpwent (and alike) function on HP UX 10.20

Found a similar posting in the comp.sys.hp.hpux newsgroup and they suggested try adding -fno-strict-prototype to your gcc line. Don't know what the equivalent (if any) for aCC would be.

-Santosh
Life is what's happening while you're busy making other plans