It seems that 'program_name' variable (const char *) must be included in every binary linking to libgnupdf, due to the fact that it is declared as extern in gnulib's error.c. It is at least required when executing in Mac OS X (didn't have the problem when executing in GNU/Linux). The definition of the variable as extern is only done if _LIBC is not defined when compiling the software. If _LIBC is defined, it just defines 'program_name' as 'program_invocation_name', which will be the way compilation is done in GNU/Linux.
People in Apple's unix-porting mailing list told me that it's caused by an old version of gnulib. Is this true? Or should I just always define program_name in every binary linking to libgnupdf?