iwatch icon indicating copy to clipboard operation
iwatch copied to clipboard

Can't build on FreeBSD 10.2

Open yggdr opened this issue 9 years ago • 2 comments

Hi,

just found this in OpenBSD's ports, so I thought I'd try it on FreeBSD. Since it's not in their ports, I tried compiling it myself, but I ran into problems. The first was solved by moving the #include <sys/types.h> before the BSDMAKE conditional include of includes.h, lest he complains about non-existing size_t definition. But even so, this happens during make:

iwatch.c:351:6: warning: implicit declaration of function 'addnwstr' is invalid in C99
      [-Wimplicit-function-declaration]
                                        addwch(*p++);
                                        ^
iwatch.c:74:20: note: expanded from macro 'addwch'
#define addwch(_x)      addnwstr(&(_x), 1);
                        ^
1 warning generated.
cc -O2 -pipe   -std=gnu99 -std=gnu99 -Qunused-arguments  -fstack-protector   -o iwatch iwatch.o -lcurses
iwatch.o: In function `display':
iwatch.c:(.text+0xe6a): undefined reference to `addnwstr'
iwatch.c:(.text+0x1091): undefined reference to `addnwstr'
iwatch.c:(.text+0x11bd): undefined reference to `addnwstr'
iwatch.c:(.text+0x120d): undefined reference to `addnwstr'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

I looked into /usr/include/curses.h, and it seems to define the function there, but I'm not really a C programmer, so I'm stumped here.

yggdr avatar Feb 20 '16 01:02 yggdr

Makefile is written for OpenBSD. Please do ./configure && gmake (GNU make from ports) on FreeBSD.

yasuoka avatar Feb 20 '16 07:02 yasuoka

Wide character functions on OpenBSD are declared only if you compile with -D_XOPEN_SOURCE_EXTENDED flag. I say this here after so many years simply because I myself encountered this problem. Maybe it will be useful to someone.

txgk avatar Aug 11 '22 17:08 txgk