I am getting the below error while trying to compile my C++ code on Linux, I would appriciate if anybody could help me figure out how to solve this.
/home/myhome/ia-k_L/src/gias/src/db2/gias_CliApi.cc:53: error: declaration of C function int gethostname(char*, int) conflicts with
/xenv/OS/ia64/RH5.6AS_64/x86_64/usr/include/unistd.h:845: error: previous declaration int gethostname(char*, size_t) here
in file gias_CliApi.cc on line 53 I have the below declaration
extern"C"int gethostname(char *name, int namelen);
I searched the code I could see that there are all declarations in the code and this function is called just twice to get the machine name,
I think it should be safe to comment it out and use the gethostname function declared in unistd.h (as per your suggestion) . As any way its not performing any business logic so if the function declared in unistd.h give me the machine name then it should be fine...
Does that make sense to you ? ... or do you suggest some other approach..?