Vladimir
Vladimir

Reputation: 111

Creating pdfium dll

I am trying to create a dll for pdfium using Visual Studio 2013 (as in Creating a dll in pdfium) except that when I download pdfium project I set DEPOT_TOOLS_WIN_TOOLCHAIN=0, because now, by default, they use toolchain from depot_tools .

But I still get an error during the build process:

error LNK2019: unresolved external symbol _FPDF_BStr_Init referenced in function "public: class CFX_WideString __thiscall CPDFDoc_Environment::FFI_PostRequestURL(wchar_t const *,wchar_t const *,wchar_t const *,wchar_t const *,wchar_t const *)" (?FFI_PostRequestURL@CPDFDoc_Environment@@QAE?AVCFX_WideString@@PB_W0000@Z) ..\pdfium\fpdfxfa.lib(fpdfxfa_app.obj) pdfium

and similar about _FPDF_BStr_Clear

error LNK2019: unresolved external symbol _FPDF_BStr_Clear referenced in function "public: class CFX_WideString __thiscall CPDFDoc_Environment::FFI_PostRequestURL( ...

I through, that it may be problem with xfa, so I tried to build pdfium without it. I removed PDF_ENABLE_XFA from preprocessor definitions of all projects in this solution, but then i found that fxcodec and fxcrt dont build without that definition. When I leave that definitions for that projects i can successfully build pdfium project, but when i use it in my app, it fails.

Then I tried to do it in different order and got dll, but without using of FPDFSDK_EXPORTS definition. When I add it, those errors appear.

Upvotes: 2

Views: 1412

Answers (1)

dj2
dj2

Reputation: 9620

You don't need to edit the build commands to disable XFA. When you run gn args out/Debug you can add a pdf_enable_xfa=false entry. You can also disable V8 with pdf_enable_v8=false.

There was recently an option added to build a complete library for PDFium (not tested with V8 or XFA yet). If you add pdf_is_complete_lib=true and build you should just have to link against the libpdfium that is generated.

Upvotes: 4

Related Questions