profanity-im / libmesode

*Deprecated* Fork of libstrophe (https://github.com/strophe/libstrophe) for use with Profanity XMPP Client
Other
16 stars 10 forks source link

[windows] libmesode_la-sock.lo Error 1 #5

Closed tristan-k closed 8 years ago

tristan-k commented 8 years ago

I'm running Windows 10 with babun and the pact packet manager. I succefully installed all dependencies and followed the build instructions.

$ git clone https://github.com/boothj5/libmesode.git
$ cd libmesode
$ ./bootstrap.sh
$ ./bootstrap.sh
$ ./configure --prefix=/usr
$ make                                                                 /cygdrive/c/Users/tristank/Documents/code/git/github/profanity/libmesode
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"libmesode\" -DPACKAGE_TARNAME=\"libmesode\" -DPACKAGE_VERSION=\"0.9.0\" -DPACKAGE_STRING=\"libmesode\ 0.9.0\" -DPACKAGE_BUGREPORT=\"boothj5web@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmesode\" -DVERSION=\"0.9.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.     -I.  -g -O2 -MT src/libmesode_la-sock.lo -MD -MP -MF src/.deps/libmesode_la-sock.Tpo -c -o src/libmesode_la-sock.lo `test -f 'src/sock.c' || echo './'`src/sock.c
libtool: compile:  gcc -DPACKAGE_NAME=\"libmesode\" -DPACKAGE_TARNAME=\"libmesode\" -DPACKAGE_VERSION=\"0.9.0\" "-DPACKAGE_STRING=\"libmesode 0.9.0\"" -DPACKAGE_BUGREPORT=\"boothj5web@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmesode\" -DVERSION=\"0.9.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I. -g -O2 -MT src/libmesode_la-sock.lo -MD -MP -MF src/.deps/libmesode_la-sock.Tpo -c src/sock.c  -DDLL_EXPORT -DPIC -o src/.libs/libmesode_la-sock.o
src/sock.c: In function ‘sock_set_keepalive’:
src/sock.c:98:45: error: ‘TCP_KEEPALIVE’ undeclared (first use in this function)
         ret = setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
                                             ^
src/sock.c:98:45: note: each undeclared identifier is reported only once for each function it appears in
Makefile:1250: recipe for target 'src/libmesode_la-sock.lo' failed
make: *** [src/libmesode_la-sock.lo] Error 1
pasis commented 8 years ago

I'm not familiar with cygwin, but I thought it had TCP_KEEPIDLE definition (if not, libmesode tries to use TCP_KEEPALIVE). Could you grep your system headers for TCP_KEEPIDLE? If it doesn't exist I will disable keepalive feature for cygwin.

boothj5 commented 8 years ago

Recreated the compilation error on Cygwin, here's the output and grep:

src/sock.c: In function ‘sock_set_keepalive’:
src/sock.c:98:45: error: ‘TCP_KEEPALIVE’ undeclared (first use in this function)
         ret = setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
                                             ^
src/sock.c:98:45: note: each undeclared identifier is reported only once for each function it appears in
Makefile:1250: recipe for target 'src/libmesode_la-sock.lo' failed
make: *** [src/libmesode_la-sock.lo] Error 1
boothj5@boothj5-PC ~/projects-git/libmesode
$ grep -rl "TCP_KEEPIDLE" /usr/include/
/usr/include/curl/curl.h

boothj5@boothj5-PC ~/projects-git/libmesode
$ grep -rl "TCP_KEEPIDLE" /usr/local/include/

boothj5@boothj5-PC ~/projects-git/libmesode
$ grep -rl "TCP_KEEPALIVE" /usr/include/
/usr/include/curl/curl.h
/usr/include/w32api/winldap.h

boothj5@boothj5-PC ~/projects-git/libmesode
$ grep -rl "TCP_KEEPALIVE" /usr/local/include/
pasis commented 8 years ago

Should be fixed by strophe/libstrophe@3e86987f5f5f36287fb061470b570744eb1f8d86. @boothj5, could you check please?

boothj5 commented 8 years ago

Compiles on Cygwin.

tristan-k commented 8 years ago

Thanks. Works well now.