0


我想从 PDF 中提取文本,所以我尝试了 QPdfium 从这里
我尝试使用带有 Mingw32 编译器的 QT 5.12.0 编译库我按照以下步骤操作:
1 -我从项目中克隆一个,然后打开 qtpdfium.pro,选择使用 Mingw 32 编译器的发布模式。
2 -当我开始构建时,我得到了大约 18 错误

D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fsdk_actionhandler.cpp:425: error: 'class CPDF_Dest' has no member named 'GetObjectW'; did you mean 'GetObject'?
   const CPDF_Array* pMyArray = ToArray(MyDest.GetObject());
                                               ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:447: error: 'g_pdfium_print_postscript_level' was not declared in this scope
   g_pdfium_print_postscript_level = postscript_level;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fsdk_actionhandler.cpp:425: error: 'class CPDF_Dest' has no member named 'GetObjectW'; did you mean 'GetObject'?
   const CPDF_Array* pMyArray = ToArray(MyDest.GetObject());
                                               ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: no matching function for call to 'MakeUnique<<expression error> >(HDC__*&)'
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:688: error: 'CFX_WindowsDevice' was not declared in this scope
     CFX_WindowsDevice WinDC(dc);
     ^~~~~~~~~~~~~~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:689: error: 'WinDC' was not declared in this scope
     if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
         ^~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:447: error: 'g_pdfium_print_postscript_level' was not declared in this scope
   g_pdfium_print_postscript_level = postscript_level;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: 'CFX_WindowsDevice' was not declared in this scope
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                              ^~~~~~~~~~~~~~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: no matching function for call to 'MakeUnique<<expression error> >(HDC__*&)'
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:681: error: template argument 1 is invalid
     pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsDevice>(dc);
                                                                   ^
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:688: error: 'CFX_WindowsDevice' was not declared in this scope
     CFX_WindowsDevice WinDC(dc);
     ^~~~~~~~~~~~~~~~~
D:\build\qtpdfium-master\src\3rdparty\pdfium\fpdfsdk\fpdfview.cpp:689: error: 'WinDC' was not declared in this scope
     if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
         ^~~~~

那么问题是什么,在自述文件中它说我可以毫无问题地编译它,我尝试使用 MSVC 2017 32 进行编译,它给了我更多错误 187 错误,所以如果有人之前编译过它,请提供任何帮助,或者如果有任何链接可以下载二进制库而不是编译它。
提前致谢。

4

0 回答 0