podofo / podofo

A C++17 PDF manipulation library

Home Page:https://podofo.github.io/podofo/documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Libraries created by vcpkg-2023.06.20 will not link correctly

sfirouz opened this issue · comments

  • I'm submitting a:

    • Vulnerability report -> use the specific form instead!
    • [* ] Bug report
    • Feature request/suggestion
  • [Bug report] What is the current behavior?

  • When using the latest version of vcpkg-2023.06.20 to install the podofo libraries, the linker complains about "Unresolved External ..." for everything. reverting back to version 0.9.8 which is the one that comes with vcpkg-2023.02.24 does not have the same issue.

  • [Bug report] What is the expected behavior?

  • Libraries should link with our application without any missing exports.

  • [Bug report] Please provide the steps to reproduce and if possible a minimal reproduction code of the problem

  • update the vcpkg to vcpkg-2023.06.20

  • run the command vcpkg.exe install podofo:x64-windows-static

  • link the resulting podofo.lib to a Win64 app and use the following lines in your code

  • PoDoFo::PdfMemDocument document;

  • document.Load("aFilePath");

  • document.GetPages().GetCount();

  • compile the code

  • Please tell us about your environment:

    • Version/git revision: [2.41.0.windows.3]
    • Operating System: [Windows 11 64 bits
    • Package manager used: [vcpkg]
    • Visual Studio 2022 17.7.0

I found this problem too in the “static” build using the vcpkg. I think it is something related to the “Runtime Library” during the library generation. I tried to fix it for a while… but no success
The shared option works fine. For now, I’m using it…

You should have pasted some undefined symbols logs. My suggestions if you are linking against a statically precompiled version of PoDoFo: define PODOFO_STATIC and ensure you are linking against podofo_static and podofo_private, that is podofo_private is now also required, plus all the other dependent libraries. See the new section in the readme about static linking linking. In general: sorry, but linking issues are the kind of issues that users must learn to deal with, especially for static linking. I don't use vcpkg myself, and even if I did some work to ensure vcpkg maintainers were able to compile PoDoFo without patching I can't guarantee I'll look at static library experience with vcpkg in the foreseeable future.

Please also refer to the new static linking section of the readme about using precompiled builds of PoDoFo.