kevinboone / epub2txt2

A simple command-line utility for Linux, for extracting text from EPUB documents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

implicit declaration of function ‘kill'

LwsBtlr opened this issue · comments

When trying to build under macOS I get:

gcc -Wall -fPIC -fPIE -g -DVERSION=\"2.02\" -DAPPNAME=\"epub2txt\" -MD -MF build//epub2txt.deps -c -o build//epub2txt.o src//epub2txt.c
src//epub2txt.c:431:7: error: implicit declaration of function 'kill' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
      kill (getppid(), SIGTERM);
      ^
1 error generated.
make: *** [build//epub2txt.o] Error 1```

Between line 10 and 11 on epub2text.c can you add
#include <signal.h>
And tell me if that works for you?

The solution submitted by @teamcoltra solved the issue with 'make' command in my case. However, later I experienced issues when trying to execute 'sudo make install'. To resolve, I deleted the preceding '/' from PREFIX, BINDIR, MANDIR variables in Makefile. Furthermore, for the latest versions (since El Capitan if I am not mistaken) of the MacOS Apple does not allow the modification of the /usr/bin even with sudo, however, there is no such restriction with /usr/local/. Therefore, I modified PREFIX to be usr/local. Final result looks like the following:

PREFIX := usr/local
BINDIR := bin
MANDIR := share/man

Thanks for the suggestion. I've committed the change to add signal.h -- it should always have been there, but I guess by a fluke it doesn't seem to be needed on Linux. As for the problem with PREFIX, etc. -- I cross-compile this software for different platforms, and I use DESTDIR and PREFIX so that 'make install' populates a staging directory with the right structure. I haven't explained any of this, because I assumed (probably wrongly) that the defaults are OK. On Linux, it doesn't cause any problems when pathnames have a bunch of redundant / characters. So "///usr//local//bin" (or whatever) is perfectly OK. If that's not true on Mac, I need to investigate. It's tricky, though, because I don't have a Mac to test on.

/usr/local prefix is standard even in the Linux world. Nothing should touch directories managed by the package manager like /usr/bin. Multiple / in a path shouldn't matter afaik.

Sure. I'm just unsure why ismayilkarimli had to remove some of the '/' characters from PREFIX, etc. As for /usr/local -- yes, it's commonplace on Linux as well. "make install PREFIX=/usr/local" should work (it did when I checked it on Linux, anyway)

I believe this issue is now fixed. Feel free to re-open it if not.