I am trying to compile pdf-tools from MELPA under OS X, but I have an error message which I can not interpret.
I run the compilation from a terminal.
I have all dependancies installed via homebrew (poppler, zlib, ...).the PKG_CONFIG path is set correctly, everything is found, but I get the following output upon running make -s:
/elpa/pdf-tools-20150204.857/build$ export PKG_CONFIG_PATH=/usr/local/Cellar/zlib/1.2.8/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
elpa/pdf-tools-20150204.857/build$ make -s
Is case-sensitive searching enabled ? yes
Is modifying text annotations enabled ? yes
Is modifying markup annotations enabled ? yes
In file included from epdfinfo.c:20:
In file included from /usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:36:
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/gtypes.h:34:9: error: unknown type name 'bool'
typedef bool GBool;
^
In file included from epdfinfo.c:20:
In file included from /usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:37:
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/GooString.h:47:1: error: unknown type name 'class'
class GooString {
^
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/GooString.h:47:16: error: expected ';' after top level declarator
class GooString {
^
;
In file included from epdfinfo.c:20:
/usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:54:54: error: must use 'enum' tag to refer to type 'ErrorCategory'
extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
^
enum
/usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:58:25: error: must use 'enum' tag to refer to type 'ErrorCategory'
extern void CDECL error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT;
^
enum
epdfinfo.c:268:19: warning: 'tempnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that
you use mkstemp(3) instead. [-Wdeprecated-declarations]
filename = tempnam(NULL, "epdfinfo");
^
/usr/include/stdio.h:391:7: note: 'tempnam' has been explicitly marked deprecated here
char *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam);
^
1 warning and 5 errors generated.
make[2]: *** [epdfinfo-epdfinfo.o] Error 1
make[1]: *** [all] Error 2
make: *** [server/epdfinfo] Error 2
I thought that it is because of an old compiler version which comes with Yosemite, but I tried gcc-4.9 as well:
elpa/pdf-tools-20150204.857/build$ gcc-4.9 --version
gcc-4.9 (Homebrew gcc 4.9.2_1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
elpa/pdf-tools-20150204.857/build$ make CC=gcc-4.9 -s
In file included from /usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:36:0,
from epdfinfo.c:20:
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/gtypes.h:34:9: error: unknown type name 'bool'
typedef bool GBool;
^
In file included from /usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:37:0,
from epdfinfo.c:20:
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/GooString.h:47:1: error: unknown type name 'class'
class GooString {
^
/usr/local/Cellar/poppler/0.29.0/include/poppler/goo/GooString.h:47:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
class GooString {
^
In file included from epdfinfo.c:20:0:
/usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:54:54: error: unknown type name 'ErrorCategory'
extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
^
/usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:56:9: error: expected ';', ',' or ')' before 'void'
void *data);
^
/usr/local/Cellar/poppler/0.29.0/include/poppler/error.h:58:25: error: unknown type name 'ErrorCategory'
extern void CDECL error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT;
^
epdfinfo.c: In function 'mktempfile':
epdfinfo.c:268:7: warning: 'tempnam' is deprecated (declared at /usr/include/stdio.h:391): This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
filename = tempnam(NULL, "epdfinfo");
^
make[2]: *** [epdfinfo-epdfinfo.o] Error 1
make[1]: *** [all] Error 2
make: *** [server/epdfinfo] Error 2