无法使用Mingw32 QT 5.12编译QtPdfium以阅读PDF

时间:2019-01-11 00:49:19

标签: c++ qt pdfium


我想从PDF中提取文本,所以尝试了here中的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错误,因此如果有人对其进行了编译,请提供任何帮助之前,或者是否有任何链接可以二进制形式下载该库而不是对其进行编译。
预先感谢。

0 个答案:

没有答案