libpcp / pcp

PCP client library
BSD 2-Clause "Simplified" License
69 stars 30 forks source link

Compiling fails because of "strndup" and "pcp_fill_sockaddr" #14

Closed Leseratte10 closed 8 years ago

Leseratte10 commented 8 years ago

When compiling this on Ubuntu, I get the following error messages:

$ make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/me/pcp/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory '/home/me/pcp'
Making all in libpcp
make[2]: Entering directory '/home/me/pcp/libpcp'
CC       src/pcp_logger.lo
CC       src/pcp_server_discovery.lo
In file included from src/pcp_server_discovery.c:47:0:
src/pcp_utils.h:247:0: error: "strndup" redefined [-Werror]
#define strndup pcp_strndup
^
In file included from /usr/include/string.h:634:0,
from src/pcp_server_discovery.c:35:
/usr/include/x86_64-linux-gnu/bits/string2.h:1319:0: note: this is the location of the previous definition
#   define strndup(s, n) __strndup (s, n)
^
src/pcp_server_discovery.c: In function 'psd_fill_pcp_server_src':
src/pcp_server_discovery.c:107:5: error: implicit declaration of function 'pcp_fill_sockaddr' [-Werror=implicit-function-declaration]
pcp_fill_sockaddr((struct sockaddr *)&s->pcp_server_saddr,
^
cc1: all warnings being treated as errors
Makefile:508: recipe for target 'src/pcp_server_discovery.lo' failed
make[2]: *** [src/pcp_server_discovery.lo] Error 1
make[2]: Leaving directory '/home/me/pcp/libpcp'
Makefile:656: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/pcp'
Makefile:587: recipe for target 'all' failed
make: *** [all] Error 2

What might be the reason?

ptatrai commented 8 years ago

It should be fixed now by commit https://github.com/libpcp/pcp/commit/0ad3a48024fa17e29879caf902fde6e814f994dd

Leseratte10 commented 8 years ago

Thanks, it compiles now.