View Single Post
Old 02-05-2020, 05:08 PM   #1734
vds
Junior Member
vds began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2020
Device: none
Compiling k2pdfopt on linux

Hi, I've been trying to compile k2pdfopt on linux without success. I got the source from here and I'm following the steps described in the readme file.

First I run
Code:
gcc -Wall -Ofast -m64 -o k2pdfopt.o -c k2pdfopt.c
and it gives me the following error:
Code:
k2pdfopt.c:76:10: fatal error: k2pdfopt.h: No such file or directory
   76 | #include <k2pdfopt.h>
      |          ^~~~~~~~~~~~
compilation terminated.
Then I tried adding the other directories to the search path
Code:
gcc -I./willuslib/ -I./k2pdfoptlib/ -Wall -Ofast -m64 -o k2pdfopt.o -c k2pdfopt.c
and this first command runs successfully.
Then I run the second command:
Code:
g++ -Ofast -m64 -o k2pdfopt k2pdfopt.o -static -static-libgcc -static-libstdc++ -lk2pdfopt -lwillus -lgocr -ltesseract -lleptonica -ldjvu -lmupdf -lfreetype -ljbig2 -ljpeglib -lopenjpeg -lpng -lzlib -lpthread -lstdc++ -lc -lm
and it gives the following error:
Code:
/usr/sbin/ld: cannot find -lk2pdfopt
/usr/sbin/ld: cannot find -lwillus
/usr/sbin/ld: cannot find -lgocr
/usr/sbin/ld: cannot find -ltesseract
/usr/sbin/ld: cannot find -lleptonica
/usr/sbin/ld: cannot find -ldjvu
/usr/sbin/ld: cannot find -lmupdf
/usr/sbin/ld: cannot find -lfreetype
/usr/sbin/ld: cannot find -ljbig2
/usr/sbin/ld: cannot find -ljpeglib
/usr/sbin/ld: cannot find -lopenjpeg
/usr/sbin/ld: cannot find -lpng
/usr/sbin/ld: cannot find -lzlib
collect2: error: ld returned 1 exit status
Has anyone compiled it successfully on Linux? What am I doing wrong?
vds is offline   Reply With Quote