jwezorek / vs_pdfium

Google's pdfium codebase set up as a Visual Studio solution that compiles to a static library on Windows.
BSD 3-Clause "New" or "Revised" License
40 stars 20 forks source link

Can you help me pack an x64 Windows dll and lib for testing input box form filling? #9

Closed Caesar454905970 closed 1 month ago

jwezorek commented 2 months ago

The solution is set up to build to a static library. If you want to build to a DLL you need to change settings in Visual Studio. There are two toplevel projects in the solution, pdfium_lib and render_pdf. In Solution Explorer, right click on pdfium_lib and select "properties" then "Configuration Properties > General" change "Configuration Type" to "Dynamic Library (.DLL)" in the debug and release x64 configurations.

Caesar454905970 commented 2 months ago

I used your method to compile and got an error e81a88da20585aa049eb6774c4b432c

jwezorek commented 2 months ago

That's a linker error that is saying Visual Studio can't find "turbojpeg-static.lib" in vs_pdfium/pdfium_lib/pdfium/bin/x64/turbojpeg-static.lib. Verify that this file is actually there first of all.

That binary is checked into this repository and the solution is set up to link to it by having the relative path ".\pdfium\bin\x64" set in > Librarian > General > Additional Library Directories.

If the file is there and Visual Studio is not finding it, I am not sure what could be causing this unless perhaps you changed the working directory?

Caesar454905970 commented 2 months ago

build dll,show other error! image

jwezorek commented 2 months ago

Well that looks like because you changed pdfium_lib to be a DLL. The render_pdf project is set up to link to a static library. It's not going to magically just work. If you want "implicitely link" to the DLL you can do so with minor changes I think. You need to find where the stub .lib file for pdfium_lib is being created and change render_pdf's "additional library directories" such that it finds it. Doing that should get render_pdf building again but then to actually run it the DLL will need to be in the same directory as the executable. You either copy it there or set up the PATH environment variable to that the exe loader finds it.