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