pebbe / zmq4

A Go interface to ZeroMQ version 4
BSD 2-Clause "Simplified" License
1.17k stars 163 forks source link

C udpping1 example won't compile on OSX 10.11.6 #110

Closed cjosephson closed 7 years ago

cjosephson commented 7 years ago

When I run './build udpping1' I get these errors:

udpping1.c:18:5: error: use of undeclared identifier 'zctx_t' zctx_t ctx = zctx_new (); ^ udpping1.c:18:13: error: use of undeclared identifier 'ctx' zctx_t ctx = zctx_new (); ^ udpping1.c:18:19: warning: implicit declaration of function 'zctx_new' is invalid in C99 [-Wimplicit-function-declaration] zctx_t ctx = zctx_new (); ^ udpping1.c:35:19: warning: incompatible pointer types passing 'struct sockaddr_in ' to parameter of type 'const struct sockaddr ' [-Wincompatible-pointer-types] if (bind (fd, &si_this, sizeof (si_this)) == -1) ^~~~ /usr/include/sys/socket.h:582:38: note: passing argument to parameter here int bind(int, const struct sockaddr , socklen_t) DARWIN_ALIAS(bind); ^ udpping1.c:62:38: warning: incompatible pointer types passing 'struct sockaddr_in ' to parameter of type 'struct sockaddr ' [-Wincompatible-pointer-types] &si_that, &si_len); ^~~~ /usr/include/sys/socket.h:591:72: note: passing argument to parameter here ssize_t recvfrom(int, void , size_t, int, struct sockaddr restrict, ^ udpping1.c:75:25: warning: incompatible pointer types passing 'struct sockaddr_in ' to parameter of type 'const struct sockaddr ' [-Wincompatible-pointer-types] &si_that, sizeof (struct sockaddr_in)) == -1) ^~~~ /usr/include/sys/socket.h:597:31: note: passing argument to parameter here int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto); ^ udpping1.c:81:5: warning: implicit declaration of function 'zctx_destroy' is invalid in C99 [-Wimplicit-function-declaration] zctx_destroy (&ctx); ^ udpping1.c:81:20: error: use of undeclared identifier 'ctx' zctx_destroy (&ctx); ^ 5 warnings and 3 errors generated.