Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile, "fatal error: mupdf/fitz.g and much other things #1

Open
evanescente-ondine opened this issue Dec 29, 2017 · 19 comments

Comments

@evanescente-ondine
Copy link

Git version. Any idea ?

mupdf.c: In function ‘doc_draw’:
mupdf.c:22:8: error: too many arguments to function ‘fz_new_pixmap_from_page_number’
pix = fz_new_pixmap_from_page_number(doc->ctx, doc->pdf, p - 1, &ctm, fz_device_rgb(doc->ctx), 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/mupdf/fitz.h:58:0,
from mupdf.c:3:
/usr/include/mupdf/fitz/util.h:22:12: note: declared here
fz_pixmap *fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_matrix *ctm, fz_colorspace *cs);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mupdf.c:30:43: error: ‘fz_pixmap {aka struct fz_pixmap_s}’ has no member named ‘stride’; did you mean ‘storable’?
unsigned char *s = &pix->samples[y * pix->stride];
^~
Makefile:8 : la recette pour la cible « mupdf.o » a échouée
make: *** [mupdf.o] Erreur 1

@olleharstedt
Copy link

I get same errors:

cc -c -Wall -O2 -I./include mupdf.c
mupdf.c: In function ‘doc_draw’:
mupdf.c:22:8: warning: implicit declaration of function ‘fz_new_pixmap_from_page_number’ [-Wimplicit-function-declaration]
  pix = fz_new_pixmap_from_page_number(doc->ctx, doc->pdf, p - 1, &ctm, fz_device_rgb(doc->ctx), 0);
        ^
mupdf.c:22:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  pix = fz_new_pixmap_from_page_number(doc->ctx, doc->pdf, p - 1, &ctm, fz_device_rgb(doc->ctx), 0);
      ^
mupdf.c:30:43: error: ‘fz_pixmap {aka struct fz_pixmap_s}’ has no member named ‘stride’
   unsigned char *s = &pix->samples[y * pix->stride];
                                           ^
Makefile:8: recipe for target 'mupdf.o' failed
make: *** [mupdf.o] Error 1

@DuendeInexistente
Copy link

Thirding, I have the same issue on ubuntu 18.

@monkeyxite
Copy link

same issue in Ubuntu 18.04 :(

incompatible type for argument 1 of 'fz_scale' or too few arguments to function 'fz_scale'

@kalpha2
Copy link

kalpha2 commented Oct 2, 2019

I encountered the 'fz_scale' issue on Debian 9 which only comes much older version of muPdf. So given there was changes as marked for v1.14 I manually built from source. That resolved the 'fz_scale' issues but I now get
/usr/bin/ld: cannot find -lmupdf-pkcs7
/usr/bin/ld: cannot find -lmupdf-threads

@aligrudi
Copy link
Owner

aligrudi commented Oct 2, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 2, 2019

then I get a lot of undefined refs, nothing flagged as error as such and final two lines are
collect2: error: ld returned 1 exit status
make: *** [fbpdf] Error 1
mybuild.txt

@aligrudi
Copy link
Owner

aligrudi commented Oct 2, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 2, 2019

think I started with snapshot download not git, could start over if think worth it?
changing the links no joy. I tried in order you gave.
I then changed -lopenjpeg to -lopenjp2 for this system but I'm stuck on lmujs not found.

@kalpha2
Copy link

kalpha2 commented Oct 2, 2019

do you recommend a particular version of mujs to use with fbpdf and what url would you recommend to get source for mujs from?

@aligrudi
Copy link
Owner

aligrudi commented Oct 2, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 3, 2019

I started with mupdf v1.9a as from Deb 9 Repos but got the fz_scale errors. So I went to the
https://mupdf.com/ site and because fbpdf changelog had ref to v1.14 I pulled that source version and built according to the instructions. There is no --version so I can't check if the make install worked but given the fz_scale errors went away presume it did.
I copied libfreeglut.a, libmupdf-pkcs7.a, libmupdf-third.a, and libmupdf~reads.a to fbpdf/lib/ and the contents of mupdf/include into the fbpdf/include folder but perceptible differnce on the make... maybe I have to tweak the makefile.

@aligrudi
Copy link
Owner

aligrudi commented Oct 3, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 3, 2019

with the makefile reverted to original see attached. ends with
collect2: error: ld returned 1 exit status
make: *** [fbpdf] Error 1
mybuild2.txt

@aligrudi
Copy link
Owner

aligrudi commented Oct 3, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 3, 2019

lib only had I only
libfreeglut.a libmupdf-pkcs7.a libmupdf-third.a libmupdf-threads.a

so I copied libmupdf.a in there too

nm lib/libmupdf.a | grep fz_hb_free
0000000000000000 T fz_hb_free

now I get

cc -c -Wall -O2 -I./include djvulibre.c
djvulibre.c:4:30: fatal error: libdjvu/ddjvuapi.h: No such file or directory
#include <libdjvu/ddjvuapi.h>
^
compilation terminated.
Makefile:8: recipe for target 'djvulibre.o' failed
make: *** [djvulibre.o] Error 1

@aligrudi
Copy link
Owner

aligrudi commented Oct 3, 2019 via email

@kalpha2
Copy link

kalpha2 commented Oct 3, 2019

I've installed libdjvulibre-dev from deb repos so builds no errors. Now to test on unit with no X installed. thankyou

@nymius
Copy link

nymius commented Jun 5, 2024

I also encountered this errors, but finally managed to get it working with a mix of your help and other sources. Here are the steps for any future readers:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

  1. Install mupdf-1.14:
git clone https://github.com/ArtifexSoftware/mupdf.git && cd mupdf
git checkout 1.14.0
git submodule update --init
sudo apt install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev
pyenv install 2.7.18 && pyenv local 2.7.18  # install python 2 and set it as the repository python version
cd thirdparty/freeglut/
curl -X GET 'https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch?id=f9102571b69d9fc05471a592fda252681fdfdef1' | git apply
make prefix=/usr/local install -j $($(nproc) + 1)
  1. Install fbpdf:
git clone https://github.com/aligrudi/fbpdf.git
sudo apt install libdjvulibre-dev
cd mupdf
mkdir ../fbpdf/lib
cp ./build/release/{libfreeglut,libmupdf-pkcs7,libmupdf-third,libmupdf-threads,libmupdf}.a ../fbpdf/lib/
make -j $($(nproc) + 1)

@aligrudi
Copy link
Owner

aligrudi commented Jun 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants