makefile - 为 pdftohtml 制作链接器会导致编译器错误

标签 makefile compiler-errors cmake linker-errors xpdf

当我运行 make 时出现以下错误编译 xpdf。这似乎与未检测到纸张尺寸有关。我以前没有见过这种错误,通常是导致编译器提示的数学库。有没有人遇到过这种错误?

[ 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

cmake 命令的终端输出为:
$ 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

最佳答案

包裹坏了。当前可用的源代码无法正确处理 libpaper 时的情况。存在。有关正确修复错误行为的完整补丁集,请参阅 this entry在布吉拉。

关于makefile - 为 pdftohtml 制作链接器会导致编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50836801/

相关文章:

qt - qmake 如何确定在 Makefile 中使用的编译器?

java - 去除 Java8 中的@Override 注解错误

c++ - 如何将 qmake 项目移植到 cmake

cmake - 如何使 cpack 不向 RPM 添加所需的库?

c - 将 gdb 与 make 结合使用

recursion - Makefile:生成包含子目录的列表

c - 如何将 Yacc/Bison-Parser 包含到自己的项目中?

c++ - 将方法传递给函数c++

c++ - 无法使用 vector::插入 "no instance of overloaded function..."

python - 多环境coremltools安装