YACReader / yacreader

This repo contains the code of YACReader's desktop version.
https://www.yacreader.com
GNU General Public License v3.0
965 stars 94 forks source link

Fails to build with Qt6 + Poppler #352

Closed jbeich closed 1 year ago

jbeich commented 1 year ago

PDFium isn't packaged on BSDs yet, so the workaround is to disable PDF via CONFIG+=no_pdf.

$ c++ --version
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
Target: x86_64-unknown-freebsd13.1
Thread model: posix
InstalledDir: /usr/bin

$ pkg install pkgconf poppler-qt6 qt6-5compat qt6-base qt6-multimedia qt6-svg qt6-tools unarr
$ qmake6
Info: creating stash file /tmp/yacreader/.qmake.stash
$ make
cd YACReader/ && ( test -e Makefile || /usr/local/bin/qmake6 -o Makefile /tmp/yacreader/YACReader/YACReader.pro ) && make -f Makefile
Project ERROR: Could not find poppler-qt5
*** Error code 3
../common/comic.cpp:813:16: error: assigning to 'Poppler::Document *' from incompatible type 'std::unique_ptr<Document>'
    pdfComic = Poppler::Document::load(_path);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../common/comic.cpp:886:20: error: no viable conversion from 'std::unique_ptr<Page>' to 'Poppler::Page *'
    Poppler::Page *pdfpage = pdfComic->page(page);
                   ^         ~~~~~~~~~~~~~~~~~~~~
../YACReaderLibrary/initial_comic_info_extractor.cpp:45:28: error: no viable conversion from 'std::unique_ptr<Document>' to 'Poppler::Document *'
        Poppler::Document *pdfComic = Poppler::Document::load(_fileSource);
                           ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
selmf commented 1 year ago

Yes, that is a known issue.

The Qt6 interface of poppler was not available yet when @luisangelsm started working on the Qt6 port, so we did the same as you and just built with no_pdf. I am looking into supporting poppler-qt6 right now, but as this contains some subtle API changes, I will probably end up doing some refactoring on the other parts of our PDF backend as well so it does not end up as a larger mess of conditional #ifdefs than it already is.

If you are interested, I can either: