AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1522500
Accepted
Anton Samokat
Anton Samokat
Asked: 2024-08-05 15:33:54 +0800 CST2024-08-05 15:33:54 +0800 CST 2024-08-05 15:33:54 +0800 CST

如何编译和安装最新的 qpdfview pdf 阅读器?

  • 772

我的系统环境是Ubuntu 20.04。我从以下网址下载了最新的源代码qpdfview(截至目前为 0.5 版本):https://launchpad.net/qpdfview/+download

文件中的安装说明README:

它依赖于 libQtCore、libQtGui。它还依赖于 libQtSvg、libQtSql、libQtDBus、libcups 和 libz(如果启用了 SVG、SQL、D-Bus、CUPS 和 SyncTeX 支持)。它还依赖于 libmagic(如果使用 Qt 版本 4 并且启用了 libmagic 支持)。PDF 插件依赖于 libQtCore、libQtXml、libQtGui 和 libpoppler-qt4 或 libpoppler-qt5)。PS 插件依赖于 libQtCore、libQtGui 和 libspectre。DjVu 插件依赖于 libQtCore、libQtGui 和 libdjvulibre。Fitz 插件依赖于 libQtCore、libQtGui 和 libmupdf。

由于缺乏维护者,Fitz 插件目前被视为实验性的。它还缺乏对各种功能的支持,例如元数据、加密、文本搜索、文本提取、表单字段和注释。

它是使用“lrelease qpdfview.pro”、“qmake qpdfview.pro”和“make”构建的。它是使用“make install”安装的。安装路径在“qpdfview.pri”中定义。

已安装的Qt5工具和依赖项qpdfview:

sudo apt install libcups2-dev libmupdf-dev libdjvulibre-dev libspectre-dev libpoppler-qt5-dev qttools5-dev-tools qtbase5-dev qt5-qmake cmake

pwdfview使用以下命令进行编译:

lrelease qpdfview.pro
qmake qpdfview.pro
make

最后一个make命令产生以下带有错误的输出:

qpdfview-0.5$ make

( test -e Makefile.pdf-plugin || /usr/lib/qt5/bin/qmake -o Makefile.pdf-plugin qpdfview-0.5/pdf-plugin.pro ) && make -f Makefile.pdf-plugin 
make[1]: Entering directory 'qpdfview-0.5'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory 'qpdfview-0.5'
( test -e Makefile.ps-plugin || /usr/lib/qt5/bin/qmake -o Makefile.ps-plugin qpdfview-0.5/ps-plugin.pro ) && make -f Makefile.ps-plugin 
make[1]: Entering directory 'qpdfview-0.5'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory 'qpdfview-0.5'
( test -e Makefile.djvu-plugin || /usr/lib/qt5/bin/qmake -o Makefile.djvu-plugin qpdfview-0.5/djvu-plugin.pro ) && make -f Makefile.djvu-plugin 
make[1]: Entering directory 'qpdfview-0.5'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory 'qpdfview-0.5'
( test -e Makefile.image-plugin || /usr/lib/qt5/bin/qmake -o Makefile.image-plugin qpdfview-0.5/image-plugin.pro ) && make -f Makefile.image-plugin 
make[1]: Entering directory 'qpdfview-0.5'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory 'qpdfview-0.5'
( test -e Makefile.application || /usr/lib/qt5/bin/qmake -o Makefile.application qpdfview-0.5/application.pro ) && make -f Makefile.application 
make[1]: Entering directory 'qpdfview-0.5'
g++ -Wl,-O1 -o qpdfview objects/settings.o objects/pluginhandler.o objects/shortcuthandler.o objects/rendertask.o objects/tileitem.o objects/pageitem.o objects/thumbnailitem.o objects/presentationview.o objects/searchmodel.o objects/searchitemdelegate.o objects/searchtask.o objects/miscellaneous.o objects/documentlayout.o objects/documentview.o objects/printdialog.o objects/settingsdialog.o objects/fontsdialog.o objects/helpdialog.o objects/recentlyusedmenu.o objects/recentlyclosedmenu.o objects/bookmarkmenu.o objects/bookmarkdialog.o objects/bookmarkmodel.o objects/database.o objects/mainwindow.o objects/application.o objects/main.o objects/synctex_parser.o objects/synctex_parser_utils.o objects/signalhandler.o objects/qrc_icons.o objects/moc_settings.o objects/moc_model.o objects/moc_pluginhandler.o objects/moc_shortcuthandler.o objects/moc_rendertask.o objects/moc_pageitem.o objects/moc_thumbnailitem.o objects/moc_presentationview.o objects/moc_searchmodel.o objects/moc_searchitemdelegate.o objects/moc_searchtask.o objects/moc_miscellaneous.o objects/moc_documentview.o objects/moc_printdialog.o objects/moc_settingsdialog.o objects/moc_fontsdialog.o objects/moc_helpdialog.o objects/moc_recentlyusedmenu.o objects/moc_recentlyclosedmenu.o objects/moc_bookmarkmodel.o objects/moc_bookmarkmenu.o objects/moc_bookmarkdialog.o objects/moc_database.o objects/moc_mainwindow.o objects/moc_application.o objects/moc_signalhandler.o   -lz /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so /usr/lib/x86_64-linux-gnu/libQt5Svg.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Concurrent.so /usr/lib/x86_64-linux-gnu/libQt5Sql.so /usr/lib/x86_64-linux-gnu/libQt5DBus.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread   
/usr/bin/ld: objects/documentview.o: in function `qpdfview::DocumentView::printUsingCUPS(QPrinter*, qpdfview::PrintOptions const&, int, int)':
documentview.cpp:(.text+0xb56a): undefined reference to `cupsGetDests'
/usr/bin/ld: documentview.cpp:(.text+0xb5ab): undefined reference to `cupsGetDest'
/usr/bin/ld: documentview.cpp:(.text+0xb65a): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xb769): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xb803): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xb88b): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xb8d3): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xb961): undefined reference to `cupsGetOption'
/usr/bin/ld: documentview.cpp:(.text+0xb9e7): undefined reference to `cupsGetOption'
/usr/bin/ld: documentview.cpp:(.text+0xba50): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xba90): undefined reference to `cupsGetOption'
/usr/bin/ld: documentview.cpp:(.text+0xbd1b): undefined reference to `cupsPrintFile'
/usr/bin/ld: documentview.cpp:(.text+0xbdd1): undefined reference to `cupsFreeDests'
/usr/bin/ld: documentview.cpp:(.text+0xbdde): undefined reference to `cupsFreeOptions'
/usr/bin/ld: documentview.cpp:(.text+0xbdfa): undefined reference to `cupsFreeDests'
/usr/bin/ld: documentview.cpp:(.text+0xbe07): undefined reference to `cupsFreeOptions'
/usr/bin/ld: documentview.cpp:(.text+0xbe69): undefined reference to `cupsGetPPD'
/usr/bin/ld: documentview.cpp:(.text+0xbe7f): undefined reference to `ppdOpenFile'
/usr/bin/ld: documentview.cpp:(.text+0xbe9c): undefined reference to `ppdFindOption'
/usr/bin/ld: documentview.cpp:(.text+0xbf0a): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xbf17): undefined reference to `ppdClose'
/usr/bin/ld: documentview.cpp:(.text+0xbf81): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xbfa5): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xbfcd): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xc099): undefined reference to `cupsAddOption'
/usr/bin/ld: documentview.cpp:(.text+0xc29d): undefined reference to `cupsAddOption'
/usr/bin/ld: objects/documentview.o:documentview.cpp:(.text+0xc2c5): more undefined references to `cupsAddOption' follow
/usr/bin/ld: objects/documentview.o: in function `qpdfview::DocumentView::printUsingCUPS(QPrinter*, qpdfview::PrintOptions const&, int, int)':
documentview.cpp:(.text+0xc518): undefined reference to `cupsLastErrorString'
/usr/bin/ld: documentview.cpp:(.text+0xc657): undefined reference to `cupsLastErrorString'
/usr/bin/ld: documentview.cpp:(.text+0xc6e1): undefined reference to `cupsFreeDests'
/usr/bin/ld: documentview.cpp:(.text+0xc788): undefined reference to `cupsAddOption'
/usr/bin/ld: objects/documentview.o: in function `qpdfview::DocumentView::printUsingCUPS(QPrinter*, qpdfview::PrintOptions const&, int, int) [clone .cold]':
documentview.cpp:(.text.unlikely+0x955): undefined reference to `ppdClose'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.application:358: qpdfview] Error 1
make[1]: Leaving directory 'qpdfview-0.5'
make: *** [Makefile:164: sub-application-pro-make_first-ordered] Error 2

根据这个答案,问题似乎出在源代码中。但我不确定。可能是我错过了一些额外的依赖项。将继续调查,但可能有人已经成功编译了这个程序?

compiling
  • 1 1 个回答
  • 35 Views

1 个回答

  • Voted
  1. Best Answer
    Anton Samokat
    2024-08-05T22:10:53+08:002024-08-05T22:10:53+08:00

    在steeldriver的帮助下,我发现问题出在源上(或安装说明中),而不是环境中。

    调用之前make需要将/usr/lib/x86_64-linux-gnu/libcups.so库添加到文件LIBS中的参数Makefile.application:

    LIBS = $(SUBLIBS) -lz /usr/lib/x86_64-linux-gnu/libcups.so /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so /usr/lib/x86_64-linux-gnu/libQt5Svg.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Concurrent.so /usr/lib/x86_64-linux-gnu/libQt5Sql.so /usr/lib/x86_64-linux-gnu/libQt5DBus.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread

    至此编译成功通过。

    安装配置在qpdfview.pri文件中。

    要安装编译的qpdfview:

    sudo make install
    
    • 1

相关问题

  • 我可以在不重新编译源代码的情况下重建包吗?

  • 如何在没有 sudo 权限的情况下构建应用程序?

  • 为 i7 处理器编译内核的最佳方法是什么?

  • 如何将具有依赖项的包上传到我的 PPA?

  • 如何让 .so 文件显示在包中?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve