0

I'm getting the error below when I run make to compile xpdf. It seems to do with papar sizes not been detected. I've not seen this kind of error before, usually its the math library that causes the compiler to complain. Is anyone experienced with this sort of error?

[ 71%] Linking CXX executable pdftohtml
CMakeFiles/xpdf_objs.dir/GlobalParams.cc.o: In function GlobalParams::GlobalParams(char const*)':    
GlobalParams.cc:(.text+0xdbd): undefined reference to `paperinit'
GlobalParams.cc:(.text+0xdc2): undefined reference to `systempapername'
GlobalParams.cc:(.text+0xdde): undefined reference to `paperinfo'
GlobalParams.cc:(.text+0xdee): undefined reference to `paperpswidth'
GlobalParams.cc:(.text+0xe05): undefined reference to `paperpsheight'
GlobalParams.cc:(.text+0xe48): undefined reference to `paperdone'
collect2: error: ld returned 1 exit status
make[2]: *** [xpdf/CMakeFiles/pdftohtml.dir/build.make:219: xpdf/pdftohtml] Error 1
make[1]: *** [CMakeFiles/Makefile2:428: xpdf/CMakeFiles/pdftohtml.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

The terminal output from the cmake command is:

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/g++ .
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for mkstemps
-- Looking for mkstemps - found
-- Looking for popen
-- Looking for popen - found
-- Performing Test HAVE_STD_SORT
-- Performing Test HAVE_STD_SORT - Success
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fseek64
-- Looking for fseek64 - not found
-- Looking for _fseeki64
-- Looking for _fseeki64 - not found
-- Found FreeType (old-style includes): /usr/lib64/libfreetype.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.31") 
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) 
-- lcms2 not found
-- Qt5 found
CMake Deprecation Warning at cmake-config.txt:263 (cmake_policy):
  The OLD behavior for policy CMP0020 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:15 (include)


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Deprecation Warning at xpdf-qt/CMakeLists.txt:27 (cmake_policy):
  The OLD behavior for policy CMP0020 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Configuring done
-- Generating done
-- Build files have been written to: /home/usr/build/xpdf-4.00
bit
  • 443
  • 1
  • 7
  • 19
  • Undefined references usually are the consequence of a missing `target_link_libraries` call. Can you provide the CMakeLists.txt that you are using? – vre Jun 13 '18 at 12:15
  • @vre here are links for [Makefile](https://pastebin.com/hFCR77Ts) and [MakeList.txt](https://pastebin.com/3cFJLS1Y). – bit Jun 13 '18 at 13:43
  • @vre It's not my code but I'm sure you know that by now. How do I add the target_link_library myself? – bit Jun 13 '18 at 14:00
  • Yes, I know that this is not your code. CMake tries to find libpaper but does not succeed. It looks for `paper` or `libpaper` in `lib` or `lib64` and does not find it there. Either it is not installed on your system or is located in a different path. Please post the terminal output of the `CMake` configuration step and attach that to your post. There must be some notice about not finding libpaper on your system. Delete CMakeCache.txt file before re-running CMake. – vre Jun 13 '18 at 14:18
  • @vre I've added the terminal output you requested. I noticed that the output does not show any record of `cmake` trying to look for libpaper. I looked at the code for libpaper in `cmake-config.txt` and I think that it is missing the path that tells `cmake` where to look. – bit Jun 13 '18 at 15:24
  • Here is link to [cmake-config.txt](https://pastebin.com/twRH97L5) in case its useful. As for libpaper on my system, `whereis libpaper` returns `/usr/lib64/libpaper.so /etc/libpaper.d` – bit Jun 13 '18 at 15:30

1 Answers1

0

The package is broken. The current available source code does not properly handle the case when libpaper is present. For a full patch set that fixes the wrong behavior properly see this entry in Bugzilla.

vre
  • 6,041
  • 1
  • 25
  • 39