Bug 692821 - error compiling external applications like fbpdf, which depend on mupdf, caused by fitz.h and missing memento.h
Summary: error compiling external applications like fbpdf, which depend on mupdf, caus...
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: fitz (show other bugs)
Version: unspecified
Hardware: PC Linux
: P4 critical
Assignee: Tor Andersson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-29 11:04 UTC by Army
Modified: 2014-08-01 04:42 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Army 2012-01-29 11:04:52 UTC
This is for the git snapshot of mupdf, those problems don't appear with stable mupdf 0.9!


I get this error compiling fbpdf or the mupdf branch of zathura

In file included from mupdf.c:3:0:
/usr/include/fitz.h:23:21: fatal error: memento.h: No such file or directory
compilation terminated.
make: *** [mupdf.o] Error 1

Looking into fitz.h, I see

#include "memento.h"

so the memento.h header is supposed to be there as well. Mupdf's buid process doesn't install memento.h into /usr/include. I build mupdf with the most recent git snapshot like this:

make build=release install

Manually installing memento.h to /usr/include produces this output when I try to compile fbpdf.

mupdf.c:10:2: error: unknown type name ‘pdf_xref’
mupdf.c: In function ‘doc_draw’:
mupdf.c:23:2: warning: passing argument 1 of ‘pdf_load_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:458:11: note: expected ‘struct pdf_document *’ but argument is of type ‘struct pdf_page **’
mupdf.c:23:2: warning: passing argument 2 of ‘pdf_load_page’ makes integer from pointer without a cast [enabled by default]
/usr/include/mupdf.h:458:11: note: expected ‘int’ but argument is of type ‘int *’
mupdf.c:23:2: error: too many arguments to function ‘pdf_load_page’
/usr/include/mupdf.h:458:11: note: declared here
mupdf.c:25:2: error: too few arguments to function ‘fz_new_display_list’
/usr/include/fitz.h:1445:18: note: declared here
mupdf.c:26:2: warning: passing argument 1 of ‘fz_new_list_device’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1447:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_display_list *’
mupdf.c:26:2: error: too few arguments to function ‘fz_new_list_device’
/usr/include/fitz.h:1447:12: note: declared here
mupdf.c:27:2: warning: passing argument 1 of ‘pdf_run_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:467:6: note: expected ‘struct pdf_document *’ but argument is of type ‘int *’
mupdf.c:27:2: error: too few arguments to function ‘pdf_run_page’
/usr/include/mupdf.h:467:6: note: declared here
mupdf.c:37:2: warning: passing argument 1 of ‘fz_new_pixmap_with_rect’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:940:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_colorspace *’
mupdf.c:37:2: error: incompatible type for argument 2 of ‘fz_new_pixmap_with_rect’
/usr/include/fitz.h:940:12: note: expected ‘struct fz_colorspace *’ but argument is of type ‘fz_bbox’
mupdf.c:37:2: error: too few arguments to function ‘fz_new_pixmap_with_rect’
/usr/include/fitz.h:940:12: note: declared here
mupdf.c:40:2: warning: passing argument 1 of ‘fz_new_draw_device’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1392:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_glyph_cache *’
mupdf.c:41:2: error: too few arguments to function ‘fz_execute_display_list’
/usr/include/fitz.h:1448:6: note: declared here
mupdf.c:51:2: warning: passing argument 1 of ‘fz_drop_pixmap’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:944:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_pixmap *’
mupdf.c:51:2: error: too few arguments to function ‘fz_drop_pixmap’
/usr/include/fitz.h:944:6: note: declared here
mupdf.c:52:2: warning: passing argument 1 of ‘fz_free_display_list’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1446:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_display_list *’
mupdf.c:52:2: error: too few arguments to function ‘fz_free_display_list’
/usr/include/fitz.h:1446:6: note: declared here
mupdf.c:53:2: warning: passing argument 1 of ‘pdf_free_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:460:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct pdf_page *’
mupdf.c:53:2: error: too few arguments to function ‘pdf_free_page’
/usr/include/mupdf.h:460:6: note: declared here
mupdf.c:54:2: warning: implicit declaration of function ‘pdf_age_store’ [-Wimplicit-function-declaration]
mupdf.c:54:25: error: request for member ‘store’ in something not a structure or union
mupdf.c: In function ‘doc_pages’:
mupdf.c:60:2: warning: passing argument 1 of ‘pdf_count_pages’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:456:5: note: expected ‘struct pdf_document *’ but argument is of type ‘int *’
mupdf.c: In function ‘doc_open’:
mupdf.c:67:2: warning: implicit declaration of function ‘fz_new_glyph_cache’ [-Wimplicit-function-declaration]
mupdf.c:67:18: warning: assignment makes pointer from integer without a cast [enabled by default]
mupdf.c:68:2: warning: implicit declaration of function ‘pdf_open_xref’ [-Wimplicit-function-declaration]
mupdf.c:72:2: warning: implicit declaration of function ‘pdf_load_page_tree’ [-Wimplicit-function-declaration]
mupdf.c: In function ‘doc_close’:
mupdf.c:81:2: warning: implicit declaration of function ‘pdf_free_xref’ [-Wimplicit-function-declaration]
mupdf.c:82:2: warning: implicit declaration of function ‘fz_free_glyph_cache’ [-Wimplicit-function-declaration]
make: *** [mupdf.o] Error 1


I'm not sure if fbpdf even compiles, maybe it is broken itself, but this missing memento.h header file is definitely causing problems.

I hope this is all informations you need, if not, I can tell you more.
Comment 1 Robin Watts 2012-02-02 00:24:54 UTC
Fixed in:

commit 16c575d5b9fb0ce4488cac07d2b09ccbcaaf95c9
Author: Robin Watts <robin.watts@artifex.com>
Date:   Wed Feb 1 15:04:30 2012 +0000

    Fix Bug 692821: make mupdf install target install memento.h too

    And mucbz.h.


Please let us know if this doesn't solve it for you.
Comment 2 Army 2012-02-02 11:11:32 UTC
Unfortunately no. Here's the output of the compilation process of fbpdf. In the first moment it looks just like the output it created when I manually copied the memento.h header file to /usr/share. Hope you find the culprit, unfortunately I can't be of any help here.

cc -c -Wall -O2 -I./include fbpdf.c
cc -c -Wall -O2 -I./include mupdf.c
mupdf.c:10:2: error: unknown type name ‘pdf_xref’
mupdf.c: In function ‘doc_draw’:
mupdf.c:23:2: warning: passing argument 1 of ‘pdf_load_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:458:11: note: expected ‘struct pdf_document *’ but argument is of type ‘struct pdf_page **’
mupdf.c:23:2: warning: passing argument 2 of ‘pdf_load_page’ makes integer from pointer without a cast [enabled by default]
/usr/include/mupdf.h:458:11: note: expected ‘int’ but argument is of type ‘int *’
mupdf.c:23:2: error: too many arguments to function ‘pdf_load_page’
/usr/include/mupdf.h:458:11: note: declared here
mupdf.c:25:2: error: too few arguments to function ‘fz_new_display_list’
/usr/include/fitz.h:1448:18: note: declared here
mupdf.c:26:2: warning: passing argument 1 of ‘fz_new_list_device’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1450:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_display_list *’
mupdf.c:26:2: error: too few arguments to function ‘fz_new_list_device’
/usr/include/fitz.h:1450:12: note: declared here
mupdf.c:27:2: warning: passing argument 1 of ‘pdf_run_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:467:6: note: expected ‘struct pdf_document *’ but argument is of type ‘int *’
mupdf.c:27:2: error: too few arguments to function ‘pdf_run_page’
/usr/include/mupdf.h:467:6: note: declared here
mupdf.c:37:2: warning: passing argument 1 of ‘fz_new_pixmap_with_rect’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:940:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_colorspace *’
mupdf.c:37:2: error: incompatible type for argument 2 of ‘fz_new_pixmap_with_rect’
/usr/include/fitz.h:940:12: note: expected ‘struct fz_colorspace *’ but argument is of type ‘fz_bbox’
mupdf.c:37:2: error: too few arguments to function ‘fz_new_pixmap_with_rect’
/usr/include/fitz.h:940:12: note: declared here
mupdf.c:40:2: warning: passing argument 1 of ‘fz_new_draw_device’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1395:12: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_glyph_cache *’
mupdf.c:41:2: error: too few arguments to function ‘fz_execute_display_list’
/usr/include/fitz.h:1451:6: note: declared here
mupdf.c:51:2: warning: passing argument 1 of ‘fz_drop_pixmap’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:944:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_pixmap *’
mupdf.c:51:2: error: too few arguments to function ‘fz_drop_pixmap’
/usr/include/fitz.h:944:6: note: declared here
mupdf.c:52:2: warning: passing argument 1 of ‘fz_free_display_list’ from incompatible pointer type [enabled by default]
/usr/include/fitz.h:1449:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct fz_display_list *’
mupdf.c:52:2: error: too few arguments to function ‘fz_free_display_list’
/usr/include/fitz.h:1449:6: note: declared here
mupdf.c:53:2: warning: passing argument 1 of ‘pdf_free_page’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:460:6: note: expected ‘struct fz_context *’ but argument is of type ‘struct pdf_page *’
mupdf.c:53:2: error: too few arguments to function ‘pdf_free_page’
/usr/include/mupdf.h:460:6: note: declared here
mupdf.c:54:2: warning: implicit declaration of function ‘pdf_age_store’ [-Wimplicit-function-declaration]
mupdf.c:54:25: error: request for member ‘store’ in something not a structure or union
mupdf.c: In function ‘doc_pages’:
mupdf.c:60:2: warning: passing argument 1 of ‘pdf_count_pages’ from incompatible pointer type [enabled by default]
/usr/include/mupdf.h:456:5: note: expected ‘struct pdf_document *’ but argument is of type ‘int *’
mupdf.c: In function ‘doc_open’:
mupdf.c:67:2: warning: implicit declaration of function ‘fz_new_glyph_cache’ [-Wimplicit-function-declaration]
mupdf.c:67:18: warning: assignment makes pointer from integer without a cast [enabled by default]
mupdf.c:68:2: warning: implicit declaration of function ‘pdf_open_xref’ [-Wimplicit-function-declaration]
mupdf.c:72:2: warning: implicit declaration of function ‘pdf_load_page_tree’ [-Wimplicit-function-declaration]
mupdf.c: In function ‘doc_close’:
mupdf.c:81:2: warning: implicit declaration of function ‘pdf_free_xref’ [-Wimplicit-function-declaration]
mupdf.c:82:2: warning: implicit declaration of function ‘fz_free_glyph_cache’ [-Wimplicit-function-declaration]
make: *** [mupdf.o] Error 1
make: *** Waiting for unfinished jobs....
Comment 3 Robin Watts 2012-02-02 12:49:41 UTC
The remaining problems are down to the fact that the mupdf API has changed slightly (and will probably change again slightly before the release of 1.0 in the very near future). fbpdf will need to be updated in line with this.

pdf_xref is now called pdf_document, and various API functions now require a context argument and fz_try/fz_catch blocks around them.

It's generally a simple matter to change things over to the new scheme. If an fbpdf developer would like to talk it through with us, please invite them to join us on irc://freenode.net in channel #ghostscript.
Comment 4 Army 2012-02-02 13:30:07 UTC
Alright, like I said, I didn't know if these errors are caused by mupdf or fbpdf. In that case this issue seems to be fixed.

For those who want to use fbpdf next to the latest git snapshot of mupdf, install the stable version of mupdf, build fbpdf and reinstall the git snapshot of mupdf => fbpdf will still work.

Fixed :)
Comment 5 Robin Watts 2012-02-02 13:32:28 UTC
Within a couple of weeks (a month or so at most) the stable version will become the current git version, and that workaround won't work :(