sja@CS.PURDUE.EDU (10/21/89)
I am having trouble compiling following program
----------------
extern "C" {
#include <rpc/types.h>
}
#include <String.h>
main()
{
printf("done\n");
}
----------------
I get the msg:
make -k
g++ -c -I/usr/local/gnu/lib/g++-1.35.1.lib/g++-include l.cc
/usr/local/gnu/lib/g++-1.35.1.lib/g++-include/std.h:119: conflicting types for `void *malloc (unsigned int)'
*** Error code 1
---------------
The problem is that <rpc/types.h> has
extern char* malloc(); => extern char* malloc(...)
This declaration conflicts with the
void *malloc(unsigned int);
Is there a way to tell the compiler that both declarations refers to the
same malloc function ?
How is overload resolution done in g++ ? I would appreciate any information
in this regard.
Thanks,
Jags
sja@cs.purdue.edu