Operating System - HP-UX
1748154 Members
3634 Online
108758 Solutions
New Discussion юеВ

Re: Compile with gcc using ndbm.h - too many arguments

 
Andrew Lee_5
Occasional Advisor

Compile with gcc using ndbm.h - too many arguments

I want to compile a c++ program that need to use the ndbm library. However, when I compile it with:
# g++ -g -c myprog.cpp

then it shows error:

/usr/local/include/ndbm.h:47: too many arguments to function 'DBM* dbm_open()'
myprog.cpp:99: at this point in file
/usr/local/include/ndbm.h:59: too many arguments to function 'datum dbm_firstkey()'
...
it prompts me error on every dbm_xxx function calls. All saying "too many arguments".
I could successfully compile on my linux box. But can't compile on this HP-UX 11i box.
Any information is welcome.
Thanks!

Anderw Lee
3 REPLIES 3
Andrew Lee_5
Occasional Advisor

Re: Compile with gcc using ndbm.h - too many arguments

more info:
I'd checked the number of argument in my program should be correct.
Hartmut Lang
Trusted Contributor

Re: Compile with gcc using ndbm.h - too many arguments

Can you give the output of "gcc -v".

Hartmut
Andrew Lee_5
Occasional Advisor

Re: Compile with gcc using ndbm.h - too many arguments

Thanks for your reply.
The problem is fixed now.
I found that when I install gdbm library, it will overwritten the ndbm with a different definition. Therefore the compiler wrongly located the ndbm.h to the gdbm's. I'd recovered the original ndbm.h and it can be compiled now.
Thanks again!

Andrew